P
P
ProstoUserName2020-10-11 11:42:55
C++ / C#
ProstoUserName, 2020-10-11 11:42:55

Why is it better to use getline, and what is cin for?

The main difference is that getline is a function and cin is an object. But how does this affect usage?

Answer the question

In order to leave comments, you need to log in

2 answer(s)
A
Alexander Ananiev, 2020-10-11
@SaNNy32

https://stackoverflow.com/questions/4745858/stdcin...

D
Dmitry Pavlov, 2020-10-11
@Stalker31

getline to get the text written before the enter key was pressed, cin to get the text up to the first space (i.e. " ".

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question