I run the basic code and the console window opens and closes so fast I don’t know if it did anything! How can I make it stay open?
1 Like
Try running without debugging. Debug > Start Without Debugging or Ctrl + F5
1 Like
Excellent, That worked just fine. Thank you
1 Like
As shown in the picture, you can put a red dot off to the side that tells the console when to close. This will keep your console window open if you want to run while debugging.
You can add the dot by just clicking in that grey area.
1 Like
As an alternative:
#include <stdlib.h> // <- include this header
int main()
{
// Do stuff...
system("pause"); // <- will pause with "Press any key to continue..."
return 0;
}
1 Like
The red dot did not work for me.
Rather than adding a pause command I updated the linker settings for the BullCowGame project to use the console subsystem as explained here
2 Likes