Q. What header files do I need in order to define the standard library functions I use?
The funny thing is, these are not necessarily the files that define what you're looking for. Your compiler guarantees that (for example) if you want the EDOM macro, you can get it by including <errno.h>. EDOM might be defined in <errno.h>, or <errno.h> might just include something that defines it. Worse, the next version of your compiler might define EDOM somewhere else.
Don't look in the files for the definition and use that file. Use the file that's supposed to define the symbol you want. It'll work.
A few names are defined in multiple files: NULL, size_t, and wchar_t. If you need a definition for one of these names, use a file you need to include anyway, or pick one arbitrarily. (<stddef.h> is a reasonable choice; it's small, and it defines common macros and types.)
Standard library functions header files.
Function/Macro | | Header File |
abort | - | stdlib.h |
abs | - | stdlib.h |
acos | - | math.h |
asctime | - | time.h |
asin | - | math.h |
assert | - | assert.h |
atan | - | math.h |
atan2 | - | math.h |
atexit | - | stdlib.h |
atof | - | stdlib.h |
atoi | - | stdlib.h |
atol | - | stdlib.h |
bsearch | - | stdlib.h |
BUFSIZ | - | stdlib.h |
calloc | - | stdlib.h |
ceil | - | math.h |
clearerr | - | stdio.h |
clock | - | time.h |
CLOCKS_PER_SEC | - | time.h |
clock_t | - | time.h |
cos | - | math.h |
cosh | - | math.h |
ctime | - | time.h |
difftime | - | time.h |
div | - | stdlib.h |
div_t | - | stdlib.h |
EDOM | - | errno.h |
EOF | - | stdio.h |
ERANGE | - | errno.h |
errno | - | errno.h |
exit | - | stdlib.h |
EXIT_FAILURE | - | stdlib.h |
EXIT_SUCCESS | - | stdlib.h |
exp | - | math.h |
fabs | - | math.h |
fclose | - | stdio.h |
feof | - | stdio.h |
ferror | - | stdio.h |
fflush | - | stdio.h |
fgetc | - | stdio.h |
fgetpos | - | stdio.h |
fgets | - | stdio.h |
FILE | - | stdio.h |
FILENAME_MAX | - | stdio.h |
floor | - | math.h |
fmod | - | math.h |
fopen | - | stdio.h |
FOPEN_MAX | - | stdio.h |
fpos_t | - | stdio.h |
fprintf | - | stdio.h |
fputc | - | stdio.h |
fputs | - | stdio.h |
fread | - | stdio.h |
freopen | - | stdio.h |
No comments:
Post a Comment