// demoCString.cpp
// Demonstrates C-strings

#include <iostream>

using namespace std;

int main()
{
   // Announce purpose of program:
   cout << "This program demonstrates a C-string variable." << endl;

   // Input a C-string:
   cout << "Enter a word between 3 and 10 characters long:>";
   char word[11];    // 10 characters plus the null character
   cin >> word;

   // Output C-string, and then output its first three characters:
   cout << "You typed: " << word << endl;
   cout << "The first three characters in your word are: "
        << word[0] << word[1] << word[2] << endl;

   return 0;
}  // function main