struct & global variable

Mohsen Pahlevanzadeh mohsen@pahlevanzadeh.org
Sat Sep 26 07:36:00 GMT 2009


My printf that doesn't print anything is called in func2 that i don't  
remember i wrote in previous email.
Quoting Mohsen Pahlevanzadeh <mohsen@pahlevanzadeh.org>:

> Dear all,
> i have a struct & 3 pointer to it.
> i defined them global.but i can't access globaly.
> //////////////////////////////////////////////////////////////////
> struct linked_list{
>                         int ii;
>                         const char * srcip;
>                         const char * dstip;
>                         const char * hostname;
>                         char * url;
>                         char * date;
>                         char * username;
>                         struct linked_list *next;
>                         struct linked_list *previous;
>                       };//end of struct
> static struct linked_list *last,*start;
> int filling_node(char * srcip,char * dstip,char * hostname,char * url
> ,char * date,char * username){
> ptr = new_node();
> ptr->srcip = srcip;
> .
> .
> .
> ptr->username = username;
> }
> void func2(){
> filling_node("213.217.60.13","80.90.100.71","google.com","http://google.com/?lkfj=lf","02-21-99","mohsen");
> }
> //////////////////////////////////////////////////////////////////
>
>
> But my code doesn't print anything.But, when i use my printf in
> filling_node func, i see result.So,i guess this related to global var.
> help me please.....
> -------------------------------------
> System Administrator



-------------------------------------
System Administrator




More information about the Gcc-help mailing list