Quakey
April 17th, 1999, 02:29 PM
Hi there,
Could anyone tell me which is faster to save data with fstream---
Situation: A line of text containing many segment are to be stored to a file, for example: Bob Is Cool.
Methods:
(1) Use fstream and output one word a time. Like
out << "Bob ";
out << "Is ";
out << "Cool.";
(2) Use fstream and output the whole sentence at one. Like
out << "Bob Is Cool.";
Which method is faster? Thanks for help.
Could anyone tell me which is faster to save data with fstream---
Situation: A line of text containing many segment are to be stored to a file, for example: Bob Is Cool.
Methods:
(1) Use fstream and output one word a time. Like
out << "Bob ";
out << "Is ";
out << "Cool.";
(2) Use fstream and output the whole sentence at one. Like
out << "Bob Is Cool.";
Which method is faster? Thanks for help.