#include using namespace std; int main () { cout << "size of double in bytes is " << sizeof(double) << endl; cout << "size of int in bytes is " << sizeof(int) << endl; cout << "size of char in bytes is " << sizeof(char) << endl << endl; char a[] = "ACEGIKMOQSUWY"; int j = (int) a + 10; // ordinary integer arithmetic int i = (int) ((double*)j - 2); // pointer arithmetic (on doubles) int *p = (int*) i + 3; // pointer arithmetic (on ints) char *c = (char*) p + 3; // pointer arithmetic (on chars) cout << (int *) a << " " << a << endl; cout << (int *) j << endl; cout << (int *) i << endl; cout << p << " " << *p << endl; cout << c << " " << *c << endl; cout << (char) ((*(c+1))+1) << endl; // pointer and ordinary arithmetic return 0; }