help please

expression must have bool type (or be convertible to bool)

Ex : If(ope = 's') - can someone tell me what is problem here ?
if should be all lower case. = is the assignment operator, you probably meant ==?
Look, ope is string var. and then i said cout << " enter the operation " <<

and then If(ope = 's') cout << " c = " << a + b << endl;

so can you tell me whats wrong here,i just started tp use c,i was using pascal and am lilte confused
You mean ope is of type std::string? In that case you should use == to compare two strings. 's' is char and not a string. Use double quotes to make it a string.
if (ope == "s")
Topic archived. No new replies allowed.