Magneto's journey to becoming a C++ expert.
OK, maybe not an expert but I'm going to give it a good try. Right the purpose of this thread is to consolidate all of my little problems/questions of which don't need a new thread each time.
#1
The problem - The program closes before I have time to see it in action.
The code:
Code:
#include <iostream>
using namespace std;
int main()
{
char Matt;
cout << "Please enter something for me to say: ";
cin >> Matt;
cout << "\n" << "Matt says: ";
cin.get();
cout << Matt;
return 0;
}
So far I know cin.get() can be used to stop a program and it requires the enter, to allow it to carry on. I've used cin.get() in a simpler program (Just a text output) and it worked great. I've tried moving it around in the code, but nothing seems to work.