getline()

getline: used to obtain a line of characters, including spaces

① header file: #incldue <string>

② Usage: getline (cin, string) used to get people coexist string string STRING

③ Note: Before using getline have to use scanf, it needs to be read after the scanf with getchar () line breaks, or line breaks will be read getline, be wrong

Guess you like

Origin www.cnblogs.com/shiliuxinya/p/12189199.html