no..I was actually reading the substring from the stream directly into a floating point variable and assuming that if that read failed , the part is not a number....but '+' somehow manages to arrive...
Type: Posts; User: manasij7479
no..I was actually reading the substring from the stream directly into a floating point variable and assuming that if that read failed , the part is not a number....but '+' somehow manages to arrive...
Does isdigit() work with floating points?
Consider the String entered:
sin 48.8 + cos 30
When I pass the input through the stringstream, and it is in the second iteration...would isdigit()...
but that applies to every character that can be entered....not only '+'...
oo...Got the solution....apparently...it was bypassing the whole part and entering an if block above which had a condition of being a number to enter.......Why is + being treated as a number more...
switch (s)
{
case '+':std::cout<<"D";break;
case 'c':std::cout<<"D";break;
}
This sounds somewhat...