// File: Buffer.cpp // Demonstrate full vs. line buffering. // Write a string to cout. // If run with output redirected, should appear twice! // Try it any way without \n // Try changing cout to cerr – Surprise! Need to use >& // to redirect. But, it still isn’t buffered #include #include #include using namespace std; int main() {cout << "ABCD\n" ; fork(); cout.flush(); }