i want to terminate the input at '=' character for example that i have given the input 2 +3= as soon as i give the '=' character it should process the input and display the output. Any help.. Spaces can also be included in the input. (it should not take any input after '=' character) the pl is c++ or c
+1
A:
You might want to look into the scanf function as a starting point.
FrustratedWithFormsDesigner
2009-12-10 17:16:59
scanf is evil. The recommendation by experts is to read the data into a string then use sscanf (that is the string version). For C++, I suggest std::getline and std::string.
Thomas Matthews
2009-12-10 19:00:55
Yes, though I thought scanf would the simplest place for him to start.
FrustratedWithFormsDesigner
2009-12-10 19:31:19
+2
A:
The obvious approach would be something like std::getline(intput, your_string, '=');
Jerry Coffin
2009-12-10 17:17:57