I read Alex's problem, and I had this same problem as well.
I have found a that you can write getchar(); right before the return 0; command and it will stall the code until you push a button.
for example with Ex1_2 you can write:
Code:
// Ex1_02.cpp A simple console program
#include <iostream> // Basic input and output library
int main()
{
std::cout << "This is a simple program that outputs some text." << std::endl;
std::cout << "You can output more lines of text" << std::endl;
std::cout << "just by repeating the output statement like this." << std::endl;
getchar(); // asks for a char, and then
return 0; // Return to the operating system
}
I am not certain that this is the best approach, but it has worked well for me; you can read more about the getchar() function at
http://msdn.microsoft.com/en-us/libr...v=vs.110).aspx
I hope this was helpful!
Also, if you refer Figure 1-9 on pg.16 you see that "Press any key to continue..." if you know how to make the console do this, please let me know
