Home / C Programming / Input / Output :: Discussion

Discussion :: Input / Output

  1. Point out the error in the program?

     #include 
     int main()
     {    
          FILE *fp;  
          fp=fopen("trial", "r");     
          fseek(fp, "20", SEEK_SET);     
          fclose(fp);  
          return 0; 
    } 
    

  2. A.

    Error: unrecognised Keyword SEEK_SET

    B.

    Error: fseek() long offset value

    C.

    No error

    D.

    None of above

    View Answer

    Workspace

    Answer : Option B

    Explanation :

    Instead of "20" use 20L since fseek() need a long offset value.


Be The First To Comment