Why will cin and getline not work,variables not initialize and does anyone know of a way to save?

I am writing an RPG, the same one as in the lounge and i am having trouble with cin, getline and variables are not initializing (i am declaring them and where necessary giving an initial value but then whenever i try to use them they say they are undefined. The allways have values, i make sure.
Last edited on
Post code. Try reproducing the error in a smaller amount of code, if there is a lot.
thanks will do.
Also, if you're still having problems with the code, try posting functions/sections of your code that you THINK are causing the problem(s). Lastly, cin is one of the simplest things to use... you might just have had a brain cramp in your code; make sure you have something like using namespace std; , and make sure you're not using something silly, like an >> endl; in it (I've done that before :P)
no i have definetely got using namespace std and no endl, cin is always tempremental though on my compiler. I have not done anymore work on the code today though so i dont know what its like now. I've used endl accidentally before too. Doesnt matter mutch anymore as i am going to rewrite it after looking through how to make a game 2 on this website. The code that was causing the problem was
1
2
3
4
5
if (missionnumber = 2){
		cin >> passcode

		// roman mission 2
	}


Last edited on
Topic archived. No new replies allowed.