A question about file I/O...
I am wondering what is the most commonly used method for file input/output for windows based text/binary files? I have seen people use ''FILE'', and I have seen people use fstream. Is there much of a difference between the two in terms of performance/ease of use?
Moe''s site
I don''t know about perfomance but I''d go with fstream for ease of use.
Firstly, who doesn''t know how to use << and >>? What''s more, you can overload the << and >> operators for your classes.
Firstly, who doesn''t know how to use << and >>? What''s more, you can overload the << and >> operators for your classes.
using the standard c funtions is easy as well. i mean who dont know how to use fread()/fwrite()? whats more you can wrap the functions for your use.
Basiclly i would say use fstream if your going to be extracing data into a C++ String..
string temp;
User fread/fwrite if your going to be extracting data into a C Character string
char temp[30];
string temp;
User fread/fwrite if your going to be extracting data into a C Character string
char temp[30];
Now what about reading in files that are mixed numbers and characters? Does that really change anything?
Moe''s site
Moe''s site
This topic is closed to new replies.
Advertisement
Popular Topics
Advertisement