Strings:

  1. A data type to accept a string of characters.
  2. Requires the string library:   #include ‹string›;
  3. Declaration:   string name;
  4. Assignment:   name = "Fred";  
    //enclosed in double quotes.
  5. Reading: cin >> name;
    //only reads to a space or return.
  6. getline (cin, name);
    reads everything until a return.
  7. cin.ignore(80,'\n');   skips to the next line. E.g.:
    cin >> age;
    cin.ignore(80,'\n');
      needed or name is read as the linefeed and empty.
    cin >> name;
  8. Operations on strings?