Writting to a file

Started by
2 comments, last by xiros 21 years, 7 months ago
I need to write data into a plain text file. I can write a string with fputs but how would I write a number from a variable?
Advertisement
fprintf(myFile, "%d", myVariable)

That''s one way ...
ReactOS - an Open-source operating system compatible with Windows NT apps and drivers
thanks, that works fine for me.
And a tip, maybe not for you, but others who might read this.
Alot of c stuff can be used to write/read files.
ex.
fprintf (from printf)
fgets (from gets)
fputc (from putc)
fgetc (from getc)

well, you get the picture, look in MSDN
It was a while since I used C, but I think I remember it..

- Twixly, the animated fool.
- ICQ : 29553198
Windows - Dev-Cpp 4.9.9 - SDL - SDL_Net

This topic is closed to new replies.

Advertisement