Home / MCQ Bank / Computer
Computer Plus Plus Miscellaneous

What will be the output of the following C++ code in text files? #include <stdio.h> int main () { char buffer[BUFSIZ]; FILE *p1, *p2; p1 = fopen ("myfile.txt", "w"); p2 = fopen ("myfile2.txt", "a"); setbuf ( p1 , buffer ); fputs ("Buffered stream", p1); fflush (p1); setbuf ( p2 , NULL ); fputs ("Unbuffered stream", p2); fclose (p1); fclose (p2); return 0; }

Select the best option to verify your answer:
Show Correct Answer
Correct Answer: Option D • Buffered & Unbuffered stream

Related Computer Questions

In C++, which keyword can be used to prevent a virtual function from being overridden in derived classes? What is the purpose of the PartialViewResult class in ASP.NET MVC? In the context of string matching, what does the term "partial match table" refer to? For an euler tour of a tree, how many vertices are required to store euler tour? What happens when only one argument is supplied to reset() function?