Hi,
I'm using the following code:
Inside the loop its printing the a_ids but outside its printing the last value of strtok(a_id,"G").Code:while(!feof(f)) { fgets (all_id, 100 , f); sscanf (all_id,"%*s %s %s",a_id,d_id); str[i] = a_id; printf("\n%s",str[i]); strtok(a_id,"G"); ida = strtok (NULL, "G"); idsa[i]=atoi(ida); i++; } printf("\n%s",str[2]);
Why is this happening?
Appreciate your guidance.
Thanks,
Angkar