global structure pointers
assume we have a function to print out a header of a specific protocol like ip.
i have my prototype function declared
in main i initialise a pointer to the header.
void print_ip(struct iphdr *ip);
my problem is that i cant access the pointer in every function itself because its declared in main.
struct iphdr *ip;
ip = (struct iphdr *) (DATA_BUFFER + ipheadersize + ethernetheadersize);
when i write all that as globals, gcc comes up with errors like: initialization makes integer from pointer without a cast.
why is this happening? and why isnt this happening when i initialize the structure pointers in main?