global structure pointers
hi!
assume we have a function to print out a header of a specific protocol like ip.
i have my prototype function declared
Code:
void print_ip(struct iphdr *ip);
in main i initialise a pointer to the header.
Code:
struct iphdr *ip;
ip = (struct iphdr *) (DATA_BUFFER + ipheadersize + ethernetheadersize);
my problem is that i cant access the pointer in every function itself because its declared in main.
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?
thank you