Structuring a file for I/O

This is a discussion on Structuring a file for I/O within the C Programming forums, part of the General Programming Boards category; Hey again.
Thanks to those who helped in that other thread. I've got a more theoretical question now. Basically, I ...

I want to read a series of information from a file, into that struct, and add/edit applicants from the file at a later time (in the case of editing, means re-writing the complete file, of which I am aware).

Here's the skeleton code, the structure of which, will probably change once I implement the missing functionality:

My question is to do with how to structure this file for reading from/writing to it. If I delimited each 'field' with a \t character, then I'd have to use repeated calls to strchr() to replace tabs in any input, which would subsequently be written back to the file, to stop the reading operation from messing up.

Would I use fscanf() for this? In some of the threads I've been reading through (there's 2,447 (probably 2,448 after posting this) threads if you search on 'file' lol), some people seem to be against the use of this function. I must admit, the error-handling implications of fscanf() are what I'd like to avoid, or at least, fix. I guess that's the reason for posting this thread.

You are getting into trouble due to binding. Break out the list and data structure into two separate structures. Make the list node so it has one pointer which will point to an applicant structure. Make the applicant structure fixed length by changing the pointers to char strings of the max required length. Use fread/fwrite to load and store the structures.

Thanks ever so much for the reply. I think you've got a good point with the data structure. I think the only place I *should* have a pointer, is for the comments, i.e. char *comments; but other than that, you're right.

One other thing I realise this morning, is that I don't necessarily need to keep one applicant per line in the file, which is what I was thinking originally. I could spread it over several lines.

Anyway, thanks for the suggestion, I'll have a bash at it in a little while.