#158712 - 11X_daemon_X11 - Mon Jun 16, 2008 7:45 pm
Alright, I had someone help me with this, and I came up with this:
//Nds text writer
#include <iostream>
#include <fstream>
#include <string>
int main ( )
{
string filename;
cin >> filename;
filename += ".txt";
ofstream ndstxt(filename); // might need filename.c_str()
if (ndstxt)
{
string line;
while (getline(cin,line)) {
ndstxt << line;
}
ndstxt.close( ); // slightly superfulos, will get closed anyway.
}
else
{
cout<<"ERROR ABORT"
}
return 0;
}
Now, does this seem a little more logical to write a text file and allow player input?
_________________
IRC (please join :D):
http://evilnetirc.ath.cx/
//Nds text writer
#include <iostream>
#include <fstream>
#include <string>
int main ( )
{
string filename;
cin >> filename;
filename += ".txt";
ofstream ndstxt(filename); // might need filename.c_str()
if (ndstxt)
{
string line;
while (getline(cin,line)) {
ndstxt << line;
}
ndstxt.close( ); // slightly superfulos, will get closed anyway.
}
else
{
cout<<"ERROR ABORT"
}
return 0;
}
Now, does this seem a little more logical to write a text file and allow player input?
_________________
IRC (please join :D):
http://evilnetirc.ath.cx/