How To Ask Question, Get Input, Clear Screen, Ask Question, Get Input, Clear Screen.....
Posted on 2005-04-21
Hello All. I am a newbie to C++ programming. As a matter of fact, I just read a few tutorials that really peaked my interest in C++. I am so excited to start that I wanted to create this simple program:
In a console window (dos) I would like to ask the user a question and save the response as a variable. Then I would like the screen to clear and repeat the process. The only problem is that when the screen clears, it does not ask the other questions. It just says "press any key to continue" and then closes the window. Here is my code:
using namespace std;
int main(int argc, char *argv)
int a, b, c, d;
cout<<"What is your name?\n\n";
cout<<"How old are you?\n\n";
cout<<"Who is your employer?\n\n";
cout<<"What is your favorite website?\n\n";
This should be fairly easy for you pros out there. Is there something wrong with my code? Obviously there is. Can someone please help me?