First posts are always the greatest.
Anyway, I'm trying to make a simple program in C++ that basically just stores information until close, such as name, age, and eventually other personal preferences that will just basically test the knowledge that I've gathered so far and for me to get used to it if I want to be a game programmer.
I'm using Dev-C++ 220.127.116.11 as my compiler. This is what I have:
This is my theory: It'll ask for your name, and you say 1 or 2. If you say 1, it continues. Great. But if you say 2, I want it to go back and give you a chance to re-enter the name, since it sets confirm back to 0, and the loop is to be done while confirm equals 0.
using namespace std;
cout<<"Hey there.\n ";
cout<<"What is your name? ";
cin.getline (name, 256, '\n');
cout<<"\n"<<name<<" is your name? \n\n Press 1 to confirm \n\n Press 2 to change \n\n", name;
cout<<"\nGot it.\nAnd how old are you? ";
cout<<"\nSo you're "<<age<<"? Alright, thanks.\n\n ";
cout<<"\nOh. Well then...\n";
cout<<"Comfirm = "<<confirm<<""; //Just to prove that the variable sets back to 0, so it SHOULD loop.
cin.ignore(); //These are just here because, well, they are. I'm not exactly most efficient yet.
The issue? It never goes back to the loop.
Please help me fix this issue. You don't necessarily need to rewrite anything, just point me in the right direction.