Here is the code:
But the compiler complains:Code:#include <stdio.h> extern end; extern edata; extern etext; int I; main(int argc, char **argv) { int i; int *ii; printf("&etext = 0x%lx\n", &etext); printf("&edata = 0x%lx\n", &edata); printf("&end = 0x%lx\n", &end); printf("\n"); ii = (int *) malloc(sizeof(int)); printf("main = 0x%lx\n", main); printf("&I = 0x%lx\n", &I); printf("&i = 0x%lx\n", &i); printf("&argc = 0x%lx\n", &argc); printf("&ii = 0x%lx\n", &ii); printf("ii = 0x%lx\n", ii); }
Code:g++ -c -g main.cc -o main.o main.cc:22: error: ISO C++ forbids declaration of `end' with no type main.cc:23: error: ISO C++ forbids declaration of `edata' with no type main.cc:24: error: ISO C++ forbids declaration of `etext' with no type



LinkBack URL
About LinkBacks



CornedBee