C++ examples for Data Type:Pointer
Pointer Increment for different size variable
#include <iostream> using namespace std; typedef struct { char c;/*from w ww . j ava2 s .c o m*/ short s; int i; long l; float f; double d; long double ld; } Primitives; int main() { Primitives p[10]; Primitives* pp = p; cout << "sizeof(Primitives) = " << sizeof(Primitives) << endl; cout << "pp = " << (long)pp << endl; pp++; cout << "pp = " << (long)pp << endl; }