answersLogoWhite

0

How do you use get line function in c plus plus?

Updated: 11/5/2022
User Avatar

Srivivekk

Lvl 1
11y ago

Best Answer

string s;

istream::getline(std::cin, s );

In the above example, s will contain whatever data is extracted from the standard input stream, as a null-terminated string.

int x; istream::getline( std::cin, x );

In the above example, x will be non-zero if the standard input stream has a non-zero value. If the input stream is non-numeric, x will be zero.

User Avatar

Wiki User

11y ago
This answer is:
User Avatar

Add your answer:

Earn +20 pts
Q: How do you use get line function in c plus plus?
Write your answer...
Submit
Still have questions?
magnify glass
imp