Why can I not concatenate this cin statement?

Why does this statement not work:
cin.get().getline(numberOne->name, 100);

yet something like this does:
cin.getline(numberOne->name, 100).get();

I assume it has something to do with what get returns to cin? Although I'm not sure.
I assume it has something to do with what get returns to cin? Although I'm not sure.


There is no need to assume - see for yourself here:
http://www.cplusplus.com/reference/iostream/istream/get/
Why are you trying to do something weird like that anyway? Just use two statements.

1
2
cin.get();
cin.getline(...);

That's much more readable.
Topic archived. No new replies allowed.