// Character strings example // References: "Understanding Character Strings." #include void main(void) { // Declare an array of up to 30 characters // The name can be up to 29 characters since the system always adds a // NULL as the final character of a character string. char user_name[30]; cout << "Enter your name: " << flush; cin >> ws; cin.getline(user_name, sizeof(user_name)); cout << "Hello, " << user_name << endl; }