Dudearoo
Useing Code::Blocks
Hey you guys!
ive got a problem with a 'test' program i have made for saveing strings.
heres the code:
#include <iostream>
#include <cstdlib>
#include <stdio.h>
#include <time.h>
#include <conio.h>
#include <stdlib.h>
#include <iomanip>
#include <windows.h>
#include <fstream>
using namespace std;
int main()
{
ofstream myfile ("savefile.txt", ios::ate | ios::in | ios::app | ios::trunc);
string stringsaveT;
string question;
if (myfile.is_open())
{
cout << "This is a .txt file save test.\n please type in a string of characters, and close the program\n once you open the program\n please type in open. " << endl;
cout << "" << endl;
cin >> question;
if (question == "open")
{
}
else if (question == "print")
{
cout << " Please Type the string you want to save." << endl;
cin >> stringsaveT;
myfile << " "<< stringsaveT <<" ";
}
myfile.close();
}
cout << "Last Cout! program reverts here first? and closes!" << endl;
return 0;
}
weird! output is just the last cout. ok, so can you guys help me figure out why the file is not opening?
Thanks!
this is only part of it i just want to see if i can open it first.
:)
(Oh by the way all my programs have as default those #include files. i only use half mostly.)