/* Filename: array3.cpp Author: Br. David Carlson Br. Isidore Minerd Date: January 6, 2000 Modified: June 26, 2000; August 20, 2001; July 16, 2009 This program prompts the user to enter his/her name. It then echo prints this name along with an error message (just to show how this could be done if an actual error occurred). Tested with: Microsoft Visual C++ 6.0 Microsoft Visual C++ .NET Microsoft Visual Studio 2008 g++ under Linux */ #include using namespace std; const int MaxString = 32; typedef char StringType[MaxString]; int main(void) { StringType UserName; StringType ErrMsg = "An error has been encountered"; cout << "Enter your complete name: "; cin.getline(UserName, MaxString); cout << endl << "User name entered was: " << UserName << endl << endl; cout << "If an error happened we could print this message:"; cout << endl << ErrMsg << endl << endl; return 0; }