![]() |
| ||
| structure and reading a text file hi, how can i read a text file "textfile.txt" with a structure? (in C) thanks the structure is in this form. typedef struct list |
| ||
| Re: structure and reading a text file Don't know the answer to your question until I know the contents of the text file. Without that knowledge, generally I would use fgets() to read a line, then parse it into its individual parts into the structure. |
| ||
| Re: structure and reading a text file the text file " textfile.txt" is in this form: 076 yr1 Santos Jose 054 yr1 Alonzo Pedro 087 yr4 Vasquez Carlos Israel 076 yr2 Marquez Juan Miguel |
| ||
| Re: structure and reading a text file you could do something like this: fscanf(fp,"%s%s%s", List[i].ID, List[i].YR, List[i].lname); Of course you will have to put the above in a loop after opening the file for reading. |
| ||
| Re: structure and reading a text file i have to read two text file "textfile.txt" and "textfile2.txt" it only reads "textfile.txt" how to join the two text and read it. |
| ||
| Re: structure and reading a text file Quote:
|
| All times are GMT -4. The time now is 7:59 am. |
Forum system based on vBulletin Copyright ©2000 - 2009, Jelsoft Enterprises Ltd.
©2003 - 2009 DaniWeb® LLC