Differentiate get( ) and getline( ) function?
Plz answer I will mark as brainliest ...☺❤
Answers
Answered by
11
The getline() function reads a whole line, and using the newline character transmitted by the Enter key to mark the end of input. The get()function is much like getline() but rather than read and discard the newline character, get()leaves that character in the input queue.
The book(C++ Primer Plus) that I am reading is suggesting using get() over getline(). My confusion is that isn't getline() safer than get()since it makes sure to end line with '\n'. On the other hand, get() will just hangs the character in the input queue, thus potentially causing problem
this is the answer of your question please mark me brainleist please please please please please please please please please please please please please please please please please please please please please please please
The book(C++ Primer Plus) that I am reading is suggesting using get() over getline(). My confusion is that isn't getline() safer than get()since it makes sure to end line with '\n'. On the other hand, get() will just hangs the character in the input queue, thus potentially causing problem
this is the answer of your question please mark me brainleist please please please please please please please please please please please please please please please please please please please please please please please
Similar questions
Science,
6 months ago
Political Science,
6 months ago
Hindi,
6 months ago
Math,
1 year ago
Social Sciences,
1 year ago
Geography,
1 year ago