I need an alternative to fstream for file input and output. When I use fstream, it bloats my program and increases the size by 30 kb. I was wondering if I should use C style file i/o or WinAPI i/o. Any input would be appreciated.
I need an alternative to fstream for file input and output. When I use fstream, it bloats my program and increases the size by 30 kb. I was wondering if I should use C style file i/o or WinAPI i/o. Any input would be appreciated.
i would go normal c style or go low level c style,
normal.. the way it should be done
in stdio.h
fopen()
fread()
fwrite()
fgets()
fputs()
fprintf()
fscanf()
fclose()
fcloseall()
us fread() and fwrite() they are the most flexible and reliable
low level, a little more difficult... agai nthe way it should be done
the header unfortunatly vaires
MSVC is io.h
open()
close()
read()
write()
ADVISORY: This users posts are rated CP-MA, for Mature Audiences only.
Thanks, I think I will go normal. Low-Level definately isn't needed; I only need to store info.
..or better, use the actual system calls that the std libs call....
CreateFile()
ReadFile()
WriteFile()
OpenFile()
You only need the windows.h and as these reside in Kernel32.dll - less bloat, but a little more work than fstreams.........
I am pretty used to these now ..... they are more or less all I use....