0

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

2
  • 2
    Is this homework? What have you tried so far? Commented Dec 10, 2009 at 17:13
  • 1
    Post some code. also, C and C++ are two almost completely different languages. Commented Dec 10, 2009 at 17:14

2 Answers 2

2

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

Sign up to request clarification or add additional context in comments.

Comments

1

You might want to look into the scanf function as a starting point.

2 Comments

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

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.