Cin Ambiguous

Dec 9, 2012 at 11:32am
closed account (LN7oGNh0)
What does this mean???
At the end of my code, I hover over cin.get() (which is what I use to pause my program. AND YES! I know it is not the best way but this isnt extremely important)
and an error comes up 'ERROR cin is ambiguous'. What could cause this and what are ways to fix this.

I have checked that I have '#include <iostream>' and 'using namspace std;'
Any suggestions?

Thanks.
Dec 9, 2012 at 12:02pm
Did you declare your own global cin? Does it work if you write std::cin instead?

Ambiguous errors means that the compiler doesn't know which version of a function or variable to use. using namspace std; is generally not recommended because if you happen to declare something in the global scope with the same name as something that has been declared in the std namespace the compiler doesn't know which one you mean when you are trying to use it.

Are you sure this isn't just a bug with IntelliSense? Do you get this error when compiling your code?
Topic archived. No new replies allowed.