Jan 14, 2012 at 9:22pm UTC
expression must have bool type (or be convertible to bool)
Ex : If(ope = 's') - can someone tell me what is problem here ?
Jan 14, 2012 at 9:25pm UTC
if
should be all lower case. = is the assignment operator, you probably meant ==?
Jan 14, 2012 at 9:43pm UTC
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
Jan 14, 2012 at 9:50pm UTC
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")