Error Handling
┌─────────────────────────┬──────────────┬─────────────────────────┬───────────┐
│ Function │ Header File │ Link to Function │ Descriptio│
├─────────────────────────┼──────────────┼─────────────────────────┼───────────┤
│ assert │ "assert.h" │ assert
│ Prints │
│ │ │ │ diag- │
│ │ │ │ nostic │
│ │ │ │ messages. │
├─────────────────────────┼──────────────┼─────────────────────────┼───────────┤
│ atexit │ "stdlib.h" │ atexit
│ Registers │
│ │ │ │ a func- │
│ │ │ │ tion to │
│ │ │ │ be exe- │
│ │ │ │ cuted at │
│ │ │ │ program │
│ │ │ │ termi- │
│ │ │ │ nation. │
├─────────────────────────┼──────────────┼─────────────────────────┼───────────┤
│ clearerr │ "stdio.h" │ clearerr
│ Resets │
│ │ │ │ error │
│ │ │ │ indica- │
│ │ │ │ tors. │
├─────────────────────────┼──────────────┼─────────────────────────┼───────────┤
│ ferror │ "stdio.h" │ ferror
│ Tests the │
│ │ │ │ error │
│ │ │ │ indicator │
│ │ │ │ for a │
│ │ │ │ specified │
│ │ │ │ stream. │
├─────────────────────────┼──────────────┼─────────────────────────┼───────────┤
│ _matherr │ "math.h" │ _matherr
│ Processes │
│ │ │ │ errors │
│ │ │ │ generated │
│ │ │ │ by the │
│ │ │ │ functions │
│ │ │ │ in the │
│ │ │ │ math │
│ │ │ │ library. │
├─────────────────────────┼──────────────┼─────────────────────────┼───────────┤
│ perror │ "stdio.h" │ perror
│ Prints an │
│ │ │ │ error │
│ │ │ │ message │
│ │ │ │ to │
│ │ │ │ stderr. │
├─────────────────────────┼──────────────┼─────────────────────────┼───────────┤
│ raise │ "signal.h" │ raise
│ Initiates │
│ │ │ │ a signal. │
├─────────────────────────┼──────────────┼─────────────────────────┼───────────┤
│ _set_crt_msg_handle │ "stdio.h" │ _set_crt_msg_handle
│ Changes │
│ │ │ │ the file │
│ │ │ │ handle to │
│ │ │ │ which │
│ │ │ │ run-time │
│ │ │ │ messages │
│ │ │ │ are sent. │
├─────────────────────────┼──────────────┼─────────────────────────┼───────────┤
│ signal │ "signal.h" │ signal
│ Allows │
│ │ │ │ handling │
│ │ │ │ of an │
│ │ │ │ interrupt │
│ │ │ │ signal │
│ │ │ │ from the │
│ │ │ │ operating │
│ │ │ │ system. │
├─────────────────────────┼──────────────┼─────────────────────────┼───────────┤
│ strerror │ "string.h" │ strerror
│ Sets │
│ │ │ │ pointer │
│ │ │ │ to system │
│ │ │ │ error │
│ │ │ │ message. │
├─────────────────────────┼──────────────┼─────────────────────────┼───────────┤
│ _strerror │ "string.h" │ _strerror
│ Tests for │
│ │ │ │ system │
│ │ │ │ error. │
└─────────────────────────┴──────────────┴─────────────────────────┴───────────┘
[Back: Summary of Library Functions]
[Next: Process Control]