struct & global variable

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


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




More information about the Gcc-help mailing list