std::cin.getline( ) vs. std::cin
问题 When should std::cin.getline() be used? What does it differ from std::cin ? 回答1: In case with char*, std::cin.getline getting line, instead of std::cin getting first word. 回答2: Let's take std::cin.getline() apart. First, there's std:: . This is the namespace in which the standard library lives. It has hundreds of types, functions and objects. std::cin is such an object. It's the standard character input object, defined in <iostream> . It has some methods of its own, but you can also use it