Home » C++ Programming » Files and Streams » Question
  1. What is the output of this program in the text file?
    #include 
    int main ()
    {
    FILE * ptr;
    char buff[] = { 'I' , 'L' , 'U' };
    ptr = fopen ( "Example.txt" , "wb" );
    fwrite (buff , 1 , sizeof(buff) , ptr );
    fclose (ptr);
    return 0;
    }
    1. I
    2. L
    3. U
    4. ILU
    5. None of these
Correct Option: D

In this program, We are writing into the file by using the function fwrite.



Your comments will be displayed only after manual approval.