can't figure out visual studio c++

Started by
14 comments, last by daviangel 14 years, 8 months ago
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?
Advertisement
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:

#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.
okay thank you everyone ive solved my problem thanks for the help.
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!
[size="2"]Don't talk about writing games, don't write design docs, don't spend your time on web boards. Sit in your house write 20 games when you complete them you will either want to do it the rest of your life or not * Andre Lamothe

This topic is closed to new replies.

Advertisement