||
for(i=-1;fscanf(dictionary_file,"%s",AUX)!=EOF && i<tablesize;)
{
printf("aux %sn",AUX);
if(AUX[0]=='>')
{
i++;
}
else if(AUX[0]=='#')
{
continue;
}
else
{
// temp variable
p = (dict *) malloc(sizeof(dict));
trim(AUX,' '); // trim head space in the AUX
//fscanf(dictionary_file,"%lf",&p->charge);
fscanf(dictionary_file,"%lf",&p->radius);
strcpy(p->symbol,AUX);
p->next=NULL; // first node point to Null
if(DIC[i]==NULL)
{
// header of the chain
DIC[i] = (dict *) malloc(sizeof(dict));
DIC[i]->next=p;
}
else
{
// the body of the chain
p->next = DIC[i]->next;
DIC[i]->next = p ;
printf("address: %pn",DIC[i]->next);
}
}
}
----------------------------------------------------
Archiver|手机版|科学网 ( 京ICP备07017567号-12 )
GMT+8, 2024-11-26 20:41
Powered by ScienceNet.cn
Copyright © 2007- 中国科学报社