C++ examples for Data Type:Array Pointer
Prints strings pointed to by an array.
#include <iostream> using namespace std; void main()//from w ww . j a v a 2 s . c o m { char *name[5]={ {"George"},{"Michelle"},{"Joe"}, {"Marcus"},{"book2s.com"} }; int ctr; for (ctr=0; ctr<5; ctr++) { cout << "String #" << (ctr+1) <<" is " << *(name+ctr) << "\n"; } return; }