Advertisement



< Prev
Next >



C++ Unformatted Input Functions






In our last article, we have introduced you to the formatted input/output functions in C++. In this article, we are only going to focus on the unformatted input functions. Unformatted console input functions are used to perform input operations at console i.e. to read an input entered by a user at the console.


Some of the most important unformatted console input functions comes from the istream class and these functions are-

Functions Description
get()
Reads a single character from a user at the console and returns it.

get(char& s)
Reads a single character entered by a user at the console and assigns it to a char variable s.

get(char* array, streamsize n))
Reads a character or a multi-word string value entered by a user at the console and assigns it to a char array.

getline(char* array, int length)
Reads a character or a multi-word string value entered by a user at the console and assigns it to a char array.

getline(istream& is, string& str)
Reads a character or a multi-word string value entered by a user at the console by using the istream object, and assigns it to a string.





How to access these unformatted I/O functions?


Please Subscribe

Please subscribe to our social media channels for daily updates.


Decodejava Facebook Page  DecodeJava Twitter Page Decodejava Google+ Page




Advertisement



Notifications



Please check our latest addition

C#, PYTHON and DJANGO


Advertisement