home *** CD-ROM | disk | FTP | other *** search
- //: C03:PointerIncrement2.cpp
- // From Thinking in C++, 2nd Edition
- // Available at http://www.BruceEckel.com
- // (c) Bruce Eckel 1999
- // Copyright notice in Copyright.txt
- #include <iostream>
- using namespace std;
-
- typedef struct {
- char c;
- 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;
- } ///:~
-