can't figure out visual studio c++
ok i figured out the problems but now when it runs it just opens the command prompt and then closes. its supposed to display some message. would it help if i put the code that im using up here?
There are a few ways to address the immediately closing window issue. I prefer just putting a breakpoint on the last closing brace in main(). Just click in the margin immediately to the left of the line to put a breakpoint on that line.
You might be interested in watching the video's on my website as well. They will guide you through step by step on how to make a game using visual studio.
Another way to address the vanishing window problem, and the way I prefer personally, is the code-intrusive approach:
I actually have a mini library of utility functions for doing console I/O. So, I have the above two function calls wrapped up into a prompt function:
Different approaches have various upsides and downsides though.
#include <iostream> // for std::cinint main(){ /* program code here */ // keep window open until user presses a key std::cin.sync(); std::cin.ignore();}
I actually have a mini library of utility functions for doing console I/O. So, I have the above two function calls wrapped up into a prompt function:
#include "console.hpp" // for console i/oint main(){ /* program code here */ console::prompt(); // alternatively: console::prompt("Press any key to exit.");}
Different approaches have various upsides and downsides though.
Quote:Original post by mmakrzem
You might be interested in watching the video's on my website as well. They will guide you through step by step on how to make a game using visual studio.
Yes, if the OP had watched the video he could've answered all his own questions.
At least the Microsoft Intro video I referred to does a pretty good job of covering the basics!
This topic is closed to new replies.
Advertisement
Popular Topics
Advertisement