Home » C++ Programming » Files and Streams » Question
  1. By seeing which operator thus this program stops getting the input?
    #include <iostream>
    #include <fstream>
    using namespace std;
    int main ()
    {
    char ch;
    streambuf * pbuf;
    ofstream os ("Example.txt");
    pbuf = os.rdbuf();
    do {
    ch = cin.get();
    pbuf -> sputc(ch);
    } while (ch != '.');
    os.close();
    return 0;
    }
    1. $ symbol
    2. dot operator
    3. insertion operator
    4. All of above
    5. None of these
Correct Option: B

This program will stop getting the input, When it occurs the dot(.) operator.



Your comments will be displayed only after manual approval.