/* ------------------------------------------------------------------- Note: The address are custimzied for the CentOS platform you may need to ADJUST the address values for different platforms Use the address values printed out by the variables printf statement to access the correct memory locations !!! ------------------------------------------------------------- */ #include int i1 = 1234; short s1 = -54; float f1 = 3.14; int main(int argc, char *argv[]) { printf("&i1 (address of int var i1) = %lu\n", &i1 ); printf("If program dumps core, change the address !\n"); printf("int value at 6294236 = %d\n", * ( (int*)6294236 ) ); printf("i1 = %d\n\n", i1); printf("&s1 (address of short var s1) = %lu\n", &s1 ); printf("If program dumps core, change the address !\n"); printf("short value at 6294240 = %d\n", * ( (short*)6294240 ) ); printf("s1 = %d\n\n", s1); printf("&f1 (address of float var f1) = %lu\n", &f1 ); printf("If program dumps core, change the address !\n"); printf("float value at 6294244 = %f\n", * ( (float*)6294244 ) ); printf("f1 = %f\n\n", f1); }