[Dev-C++] problem writing data to file
Open Source C & C++ IDE for Windows
Brought to you by:
claplace
|
From: <Bah...@ao...> - 2005-02-10 04:36:23
|
all i need to do is write a few variables (int's) to a text file. the
segment of data that makes the file looks like this :
FILE * pFile;
char buffer[] = "???";
pFile = fopen (MonName, "w");
fwrite (buffer , 1 , 100 , pFile);
fclose (pFile);
MonName is the file's name. it turns out to be whatever the contents of
MonName are
??? is what i need to change
how would i make buffer[] represent :
cout << "The level is " << level << ", and the name is " MonName;
The level is 1 and the monster name is Red Dragon
also, not as important, but how would i have .txt be placed at the end of the
file???
|