1.

What is the output of this program in text files?
#include <iostream>
int main ()
{
char buff[BUFSIZ];
FILE *ptr1, *ptr2;
ptr1 = fopen ("FirstFile.txt", "w");
ptr2 = fopen ("SecondFile.txt", "a");
setbuf ( ptr1 , buff );
fputs ("Buffered stream", ptr1);
fflush (ptr1);
setbuf ( ptr2 , NULL );
fputs ("Unbuffered stream", ptr2);
fclose (ptr1);
fclose (ptr2);
return 0;
}

A. Compilation Error
B. Buffered stream
C. Unbuffered stream
D. Buffered & Unbuffered stream
E. None of these
Answer» E. None of these


Discussion

No Comment Found

Related MCQs