I would like to learn C++, Everytime I write the code or should I say copy the code down, I get to where I want to compile but cannot get the program started. Can any one help by explaining how after I copy the code the steps from then on. Thank you in advance.

If you compile it and it won't run maybe try adding system("PAUSE"); at the end of your code (right before return 0;). This will only work on Windows and isn't portable.

I would like to learn C++, Everytime I write the code or should I say copy the code down, I get to where I want to compile but cannot get the program started. Can any one help by explaining how after I copy the code the steps from then on. Thank you in advance.

yes i can help you.please tell me clearly your query.

If you compile it and it won't run maybe try adding system("PAUSE"); at the end of your code (right before return 0;). This will only work on Windows and isn't portable.

Instead use this:

cin.ignore(cin.rdbuf()->in_avail());
cin.get();

Instead use this:

cin.ignore(cin.rdbuf()->in_avail());
cin.get();

An even better way would be run it from your console/command prompt! Since it's a "console" application!

And DO NOT use system("PAUSE"); . Not only is it non-portable, but its also a VERY expensive system call!

You should probably read the Sticky "How Do I Clear the Input Buffer?"

Chris

This article has been dead for over six months. Start a new discussion instead.