For the following types of input
( two words separated by a space)
i want to store two words separated by space in two different strings, so i used the following code
getline(cin, a,' ');
cout << a.length();
cout << b.length();
but when i calculate the length of the string for the given case ( that is- "ira ira" ) it gives the answer as 4 and 3 respectively
Why doesn't it give answer as 3 and 3??
Last edited on
stick a breakpoint on line 4 and examine a and b.
Topic archived. No new replies allowed.