Ok. I know you told me to try a simpler program to learn I/O and using files, and I have! There is one problem. In my program, all i ask is for them to input one letter, and in another program I ask it to show that letter. All it does is show nothing or one of those ||= thingies!
Here is the program where they ask for the letter:
Code:
#include<iostream>
#include<fstream>
#include<string>
using namespace std;
int main()
{
char a[2];
cout<<"Hello, and welcome to my first try at real File I/O learning!\n";
cout<<"\nNow enter any letter of the English alphabet: ";
cin.get(a, 2);
ofstream stuff("firsttry.txt", ios::out);
stuff<<a;
stuff.close();
system("PAUSE");
return 0;
}
and here is the one where it shows the letter:
Code:
#include<iostream>
#include<fstream>
#include<string>
using namespace std;
int main()
{
char ch;
ifstream openstuff("firsttry.txt", ios::in);
openstuff.get(ch);
cout<<ch;
system("PAUSE");
return 0;
}
I am sorry for annoying you again. After I get the hang of this I should be able to stop bugging you.