c ++ getline () function

1. Header file: #include <cstring>

2.getline (cin, s) passes the input to s

3. What is the difference from cin?

Cin will stop reading when it encounters a space, but getline will not stop reading if it encounters a space.

Guess you like

Origin www.cnblogs.com/miao-xixixi/p/12672660.html