tags:

views:

53

answers:

2

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
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
Yes, though I thought scanf would the simplest place for him to start.
FrustratedWithFormsDesigner
+2  A: 

The obvious approach would be something like std::getline(intput, your_string, '=');

Jerry Coffin