Could anyone please explain this problem to me?
Even if I use strncpy in place of strtok, the value retained by the str is the last value assigned to it using str[i]=a_id!
fgets (all_id, 100 , f);
sscanf (all_id,"%*s %s %s",a_id,d_id);
str[i] = a_id;
ida = strtok (NULL, "G");
Why cannot the str retain its value outside loop?
I'll be obliged if anyone could explain this fundamental misconception of mine?