|
-
Sep 26th, 2006, 06:01 AM
#1
Thread Starter
Junior Member
stdio vs fstream - C++
Is there a reason I should use functions from the fstream header rather than just using fputs from stdio if all I want to do is input a string to a text file depending on what button a user presses? There is no user supplied input so I don't need to worry security vulnerabilities or anything. All using fstream seems to do is make my exe so much bigger when all I want to do is something simple. So is it ok to use this simple function? I'm only asking because I have heard to steer clear of certain things because they have inherent problems.
Last edited by Chazwazza; Sep 26th, 2006 at 06:20 AM.
-
Sep 26th, 2006, 10:54 AM
#2
Frenzied Member
Re: stdio vs fstream - C++
 Originally Posted by Chazwazza
Is there a reason I should use functions from the fstream header rather than just using fputs from stdio if all I want to do is input a string to a text file depending on what button a user presses? There is no user supplied input so I don't need to worry security vulnerabilities or anything. All using fstream seems to do is make my exe so much bigger when all I want to do is something simple. So is it ok to use this simple function? I'm only asking because I have heard to steer clear of certain things because they have inherent problems.
So fstream is bloating your exe from 40 or 50 kb to 100 kb? Not a big jump considering the advantages of the standard library. fputs is old C code but fstream and the standard library is C++. I would say everything in the standard library is more robust, safe, and easier to use than anything C.
Posting Permissions
- You may not post new threads
- You may not post replies
- You may not post attachments
- You may not edit your posts
-
Forum Rules
|
Click Here to Expand Forum to Full Width
|