// strtype_01.cpp -- using the C++ string class
#include <iostream>
#include <string>               // make string class available
int main()
{
    using namespace std;

    char char1[20];            // create an empty array
    char char2[20] = "Sting"; // create an initialized array

    string str1;                // create an empty string object
    string str2 = "Bjork";    // create an initialized string

    cout << "Enter a celebrity with one name: ";
    cin >> char1;
    cout << "Enter another: ";
    cin >> str1;                // use cin for input
    
    cout << endl;
    cout << "Here are some celebrities w/one name:\n";
    cout << char1 << " " << char2 << " "
         << str1 << " " << str2 // use cout for output
         << endl << endl;
    cout << "The third letter in " << char2 << " is "
         << char2[2] << endl;
    cout << "The third letter in " << str2 << " is "
         << str2[2] << endl;    // use array notation
}
