Hi,
I'm a beginner in C++ and I was wondering on this issue. I have a book and I'm on page 12. Here, it gives me the code for a very basic C++ program. So, I fire up Visual Studio and proceed to type this:
#include <iostream>
using namespace std;
int main() {
cout << "This is a simple C++ program!" << endl;
}
However, when I execute, the console window opens up for less than a second, gives me the text I want and closes. Having prior experience with Visual Basic, I thought that the console window would open indefinitely. Have I written part of the code wrong? Or is it right and natural? If it is a valid code, is there any way to keep the console window open displaying the text or not?