What problem are you having? fwrite is really for binay data. If you tell it to print the int 123:
Code:
fwrite( &myint, sizeof( myint ), 1, file );
...and you open the file in a text editor, you aren't going to see "123". "Lines" are really irrelevant when using fwrite. Sure I suppose you could work that into what you are doing somehow, but you don't generally do that.

If you want text, use fprintf.


Quzah.