I have a text file that has about 50 lines of text like this:
Nancy Bush;2607 Avenue;Atlanta
I am sopossed to put it into a hashtable, but right now im just reading in the text.
My snipped of code can read the whole file in, giving me all the names, but how can i read in the street and city too? Do i just do another strtok right after the first one? (just tried it and doesnt work)
Code:FILE *filelist; filelist=fopen("fileit.txt", "r"); char line[max_string_length]; char *name,*street,*city; while(fgets(line, sizeof(line), filelist)!=NULL){ name=strtok(line,";"); street=strtok(line,";"); printf("%s\n",name); printf("%s\n",street); }