I am trying to write this loop in a simple convert process, but I get all sorts of crazy errors when I try using the "not equals" operators.

here is my code:

int main()
int i = 5;
std::string s;
cout<<" Enter a string: ";
double x = converToDouble(s);
cout<<" The answer is " << x<<endl;
}while (s<>'q');
return 0;

The line before the "return 0", I try using "<>" and "!=", but both give me errors like "error C2059: syntax error '>' " and if I used "!=" then I get "...could not deduce template argument for 'const _Elem *' from 'char'"

Is there a certain library I need to include to use these compare operators?

I'm Using Visual C++ 2005 Express.


Edited 3 Years Ago by happygeek: fixed formatting

>"error C2059: syntax error '>' "
<> doesn't mean "not equal to". You want the != operator.

>"...could not deduce template argument for 'const _Elem *' from 'char'"
String literals use double quotes and character literals use single quotes. Try s != "q" . Of course, I would be a little suspicious of your logic because even if the string is "q", you still convert and print it.

Thanks! :) That definitely got it! I can't recall that I needed to use the double quotes for strings but I guess I'm so used to the single quotes that I forgot about that.

This question has already been answered. Start a new discussion instead.