Need help with simple program

This is a discussion on Need help with simple program within the C++ Programming forums, part of the General Programming Boards category; I combaned to of the exaple's and it's not working I've tryed everthing I can think of and it's still ...

Well first of all, why dump code on us without telling the exact compiler error? If you've got the error message and you can't figure it out, why make it harder on us and make us guess the error as well the solution?

But as to what your problem in..... Why would you name a variable the same name as cin, which is an object of type..... istream (I think)? Get rid of it. You don't need that variable.

Code:

int thisnumber,

End the declaration with a semicolon, not a comma.

Also, what the heck is this line?

Code:

cout int ,<<"Please enter a number: ";

Take your time to write programs. This just shows sloppiness in writing any random thing. It means nothing. What I imagine you meant is this:

Code:

cout << "Please enter a number: ";

Code:

cin<<thisnumber;

You got the direction wrong. You're reading a number from cin to thisnumber. Hence you need:

Code:

cin >> thisnumber;

Code:

cin.ignor();

Mistake, I take it and you want cin.ignore().

Code:

cont<<"You LOST!!! HAHAHAHAH!!!!!!!!!!!\n;"
...
cont<<"Good job you won A POINTLESS GAME thank you for waisting you time!\n;"

cout perhaps?

And put the semicolons on the end of the line. Not inside the string.

Your indenting kind of sucks, too. Working on indenting will help you write, debug, and maintain software.

Furthermore, if your program compiled and executed, what would happen if you entered 100? Nothing would be printed.

You might need to add an extra cin.ignore() since it might be reading the '\n' or '\r' from the user.

Put an extra cin.ignore() before the return.

In reality, it's not the best way of handling it. You should really clear the input buffer by means of some other function I can't think of at the time, but for now, this is sufficient to see how it works.