Bad Code or Bad Computer

This code came from a book called "Beginning C++ Through Game Programming" by Michael Dawson" and the book has a set of codes and the software he used to create and run them. Whenever I try opening the codes it doesn't work. Is my computer bad or is the code bad? He is using Microsoft Visual C++ 2010 Express. (First post so i dont know how things will look)

Edit: He includes all of the code in the book in this pack http://www.delmarlearning.com/companions/start.asp

1
2
3
4
5
6
7
8
9
10
// Game Over
// A first C++ program

#include <iostream>

int main()
{
	std::cout << "Game Over!" << std::endl;
	return 0;
}
Last edited on
I dont understand how a bad computer could have anything to do with this. Either way, nothing wrong with the actual code. Its probably something wrong with Visual Studio 2010. I would recommend getting 2013 if you can.

What errors are you getting? Could you copy paste them in here?

Also, please use code tags <> under the format section for all of your code.
Its not an error, its just that the program wont run.

What is a format section? (Really new to this)
Last edited on
Can you tell us what you mean by the program wont run? Because that doesnt mean anything specific to me. Between

std::cout << "Game Over!" << std::endl;
and
return 0;

Try putting system("pause"); (this is not the best solution but it works for now so who gives a shit)

Edit: If you click edit on your post. You see format: and a bunch of icons under.

http://gyazo.com/e88a463a78c2f44eefd111e8acb7288f
Last edited on
It is more really of how do I run the program too, the run program file seems to be hollow and un-clickable. I do not understand how to operate this software

Edit: He includes all of the code in the book in this pack http://www.delmarlearning.com/companions/start.asp
Last edited on
There is a play button in visual studio, you can click that button to compile your code, or you can press F5. I haven't used 2010 in ages, but I do know you can use F5 I do not however remember if the play buton is there.
This software you are speaking of is called msdos, it is terrible ugly... Oh shit I mean it's the godsend that created windows my friend, not much you can do with it.
Topic archived. No new replies allowed.