Error Handling


  1. What is the purpose of the C function?
    int ferror(FILE *fp)











  1. View Hint View Answer Discuss in Forum

    NA

    Correct Option: A

    They check for output errors


  1. Which of the following causes an error?











  1. View Hint View Answer Discuss in Forum

    NA

    Correct Option: D

    Option A, B and C causes an error.



  1. Which of the following function can be used to terminate the main function from another function safely?











  1. View Hint View Answer Discuss in Forum

    NA

    Correct Option: A

    exit(expr);


  1. What happens when we use the following C statement?
    fprintf(stderr, "error: could not open file");











  1. View Hint View Answer Discuss in Forum

    NA

    Correct Option: C

    The diagnostic output is directly displayed in the output



  1. stderr is similar to?











  1. View Hint View Answer Discuss in Forum

    NA

    Correct Option: B

    stdin