C++ char array string variable

Description

C++ char array string variable

#include <iostream>
using namespace std;
int main()/*  w  ww . j  a  va 2  s . c o  m*/
{
   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;
}



PreviousNext

Related