1.

Which function is used to read a single character from the console in C++?(a) cin.get(ch)(b) getline(ch)(c) read(ch)(d) scanf(ch)I have been asked this question in an internship interview.This key question is from Basics topic in section Basics Concepts of C++ of C++

Answer»

The correct answer is (a) cin.get(CH)

To explain I WOULD say: C++ provides cin.get() function to read a single character from CONSOLE WHEREAS others are USED to read either a single or multiple characters.



Discussion

No Comment Found

Related InterviewSolutions