This site is no longer active, all members have migrated to devotedcheating.com . Thankyou



 
Actionhacks.netHomeFAQRegisterLog in

Share | 
 

 Basic fstream -- Saving files.

Go down 
AuthorMessage
Tate
Admin
Admin
avatar

Posts : 208
Reputation : 17
Join date : 2009-09-19
Age : 22

PostSubject: Basic fstream -- Saving files.   Fri Nov 27, 2009 1:35 pm

This is a very simple thing to do, and can help you if you're ever going to create a hack (If you want to save hack options, or something along those lines).


First, you need to add your includes.
These are the only includes youll need:
Code:
#include <iostream>
#include <fstream>


Next, make sure you tell C++ that you are using namespace std.

add
Code:
using namespace std;

Next, add your main function.

Code:
int main()
{
 
{



Now add this into your main (ill add comments):
Code:
fstream file;
file.open("test1.txt",ios::out);
file << "This is a good message!";   
system("PAUSE");
return 0;



so basicly your source code should be this:

Code:
#include <iostream>
#include <fstream>
using namespace std;

int main()
{
fstream file;
file.open("test1.txt",ios::out);
file << "This is a good message!";   
system("PAUSE");
return 0;
}


any questions, post and I should be able to answer them.

_________________
"Never pick a fight with an idiot. They'll simply bring you down to their level, then win by experience."
___________________________________
Back to top Go down
 
Basic fstream -- Saving files.
Back to top 
Page 1 of 1
 Similar topics
-
» Ten Basic Checkmates to Know
» Visual Basic Chess
» NEW: The English Patch for Hollywood Monsters (Pendulo Studios,1997).
» New Mystery Case Files at BFG
» Books in chessbase format - best way for self-training

Permissions in this forum:You cannot reply to topics in this forum
 :: Public Section: Coding :: C++ :: Tutorials-
Jump to: