C++ char array string literal.

Description

C++ char array string literal.

#include <iostream>
using namespace std;
#define MYNAME "test test"
int main()/*from  w  w w  . j a  v  a  2s.  c  om*/
{
   char name[]=MYNAME;
   cout << "My name is " << name << "\n";   // Prints the array.
   cout << "My name is " << MYNAME << "\n"; // Prints the
   // defined literal.
   return 0;
}



PreviousNext

Related