Okay, i've been trying to teach myself C++ and have been using the site's excellent tutorials, however i have a problem.
I wanted to create a simple program that collects input and then outputs it for experience.
My problem is that after the first input (name in this case) the program closes, despite being only part way through the program.
I've checked the code and it seems right to me....Can anyone tell me what the problem is? It's probably very simple, i'm new to this
The code complied correctly......
NB: The actual text the program outputs is simply there to be there, it doesn't actually mean anything!Code:#include <iostream> using namespace std; int main() { int yourname; int youraddress; int yourage; cout<<"Welcome to program testing. Thank you for deciding to become a beta tester. Please enter your name. \n"; cin>> yourname; cin.ignore(); cin.get(); cout<<"Please enter your address \n"; cin>> youraddress; cin.ignore(); cin.get(); cout<<"Please enter your age \n"; cin>> yourage; cin.ignore(); cin.get(); cout<<"Thanks. Your details are as follows <<yourname \n youraddress \n yourage \n << \n"; }