C++ examples for Data Type:Array Pointer
Increments a pointer through a character array.
#include <iostream> using namespace std; void main()/*from w ww . j ava2 s . c o m*/ { char cara[] = {'a', 'b', 'c', 'd', 'e'}; char *cp = cara; // The pointers point to the start of the array. cout << *cp << "\n"; cp++; // One is actually added. cout << *cp << "\n"; cp++; // One is actually added. cout << *cp << "\n"; cp++; // One is actually added. cout << *cp << "\n"; cp++; // One is actually added. cout << *cp << "\n\n"; cout << "The character size is " << sizeof(char); cout << " byte on this machine\n"; return; }