Help with reading in a line of string

Feb 2, 2016 at 7:25am
Hello, Thanks for your help.

line of code user enters:
Hi + Henry = polite

is it possible to store operands(in general i.e. -,+)?
 
 getline(cin,word1,'+') 
Last edited on Feb 2, 2016 at 7:28am
Feb 2, 2016 at 9:22am
what does ,'+' do ?

If you take it out you can type a string, otherwise, cin is going to stop at the first special char.

try
getline(cin,word1);
Feb 2, 2016 at 1:08pm
i need to store the operand for later use..because the user has the option to enter '-', i just ended up storing it in a string
Last edited on Feb 2, 2016 at 1:08pm
Topic archived. No new replies allowed.