Screen pops up and disappears at runtime

#include iostream

using namespace std;

int main()

cout << “Welcome to Bulls and Cows”;
return 0;

for some reason when I type <> around the iostream in the forum it deletes what is inside the <>…So in my code I do have the <> around the iostream.

When I run the above code I get the console to popup really fast and I can see that it displays the message, however to quickly disappears without me pressing any button to continue.

2 ways that I have found to solve this. 1 is to include a breakpoint in Visual Studio or create a dummy variable that waits for user input. Neither of which are convenient. Is there something that I need to change in Visual Studio or on my system?

NEVERMIND…Im an idiot…I was running it with debugging…

When I run it without debugging like I should, then it works just fine…That is my idiot moment for today…Nothing to see here…lol…

1 Like