my project just open and close fast!

hey! im learning c++ and im currently using this tutorial http://www.youtube.com/watch?v=VJGqalveGmM&list=WLC0F667FF731AB334 i tryed fixing it but i cant find out what the problem is ! i even copyed his code and used his which should be exactly like mine but it still doesent work! can someone please look at whats wrong? heres my project : http://www.mediafire.com/?vwda2w58aw5z07c please answer quick! my twitter is twitter.com/nazzergames :D
Are you sure the program does not crash for some reason? Does it print some error message?
Last edited on
closed account (N36fSL3A)
system("PAUSE") if you're a windows user.

However I'd recommend you do this:

1
2
3
4
5
6
7
8
9
10
11
int main()
{
    bool Running = true;

    while(Running)
    {
        //  Your program code here....

        // At the end make a conditional statement asking if the user wants to quit.
    }
}
Last edited on by Fredbill30
closed account (G309216C)
Erm... Nope, the programming technique is all wrong use std::cin.get();

and not while loops as they increase the CPU usage and is a crap way to do it.
Erm... Nope, the programming technique is all wrong use std::cin.get();

How is it wrong?

and not while loops as they increase the CPU usage and is a crap way to do it.

While loops do not "increase CPU usage." What's so crap about it?
well, im actually using windows and i found out that the tutorial dude used linux so there was some problems when i copyed his code, but it still does the same thing and i wonder where am i suppose to put the std::cin.get(); ?
I don't think they have looked at your code. You already have a loop very similar to what Fredbill30 suggested.

The code that you have posted does not compile because you have misspelt event on line 53.
system("PAUSE") if you're a windows user.
use std::cin.get();

Why?
If you have a program that uses stdin and stdout, why is it so impossible to simply run it from a console?
Topic archived. No new replies allowed.