/// read() + ignore()

#include <iostream>         /// cin, cout

using namespace std;


void read()
{
    char buf[80] {};

    cin.readsome(buf, 3);

    if (cin)
    {
        cout << "cin.readsome() successfully read "
             << cin.gcount() << " characters: ";

        cout << buf << endl;

        cout << "next char: " << (char) cin.peek()
             << endl;
             
        /// discard the character
        cin.ignore();
    }
    else
        cout << "cin.readsome() was unsuccessful" << endl;
}


int main()
{
	for (int i = 0; i < 3; i++)
       read();
}