C++ examples for Data Type:char array
Simple string variable
#include <iostream> using namespace std; int main()// w w w. j a v a2s . com { const int MAX = 80; //max characters in string char str[MAX]; //string variable str cout << "Enter a string: "; cin >> str; //put string in str //display string from str cout << "You entered: " << str << endl; return 0; }