Professional Documents
Culture Documents
Common C Functions
Common C Functions
This appendix lists the function prototypes contained in each of the header files supplied with most C compilers. Functions that
have an asterisk after them were covered in this book.
The functions are listed alphabetically. Following each name and header file is the complete prototype. Notice that the header
file prototypes use a notation different from that used in this book. For each parameter a function takes, only the type is given
in the prototype; no parameter name is included. Here are two examples:
Function Prototype
abort*
abs
STDLIB.H
STDLIB.H
void abort(void);
int abs(int);
acos*
asctime*
asin*
MATH.H
TIME.H
MATH.H
double acos(double);
char *asctime(const struct tm *);
double asin(double);
assert*
atan*
atan2 *
atexit*
atof*
MATH.H
STDLIB.H
STDLIB.H
atof*
atoi*
MATH.H
STDLIB.H
atol*
bsearch*
STDLIB.H
STDLIB.H
calloc*
ceil*
STDLIB.H
MATH.H
clearerr
clock*
cos*
STDIO.H
TIME.H
MATH.H
cosh*
ctime*
MATH.H
TIME.H
double cosh(double);
char *ctime(const time_t *);
difftime
div
exit*
TIME.H
STDLIB.H
STDLIB.H
exp*
fabs*
MATH.H
MATH.H
double exp(double);
double fabs(double);
422
fclose*
fcloseall*
STDIO.H
STDIO.H
feof*
fflush*
STDIO.H
STDIO.H
fgetc*
fgetpos
fgets*
STDIO.H
STDIO.H
STDIO.H
floor*
flushall*
MATH.H
STDIO.H
double floor(double);
int flushall(void);
fmod*
fopen*
fprintf*
MATH.H
STDIO.H
STDIO.H
fputc*
fputs*
STDIO.H
STDIO.H
fread*
free*
freopen
STDIO.H
STDLIB.H
STDIO.H
frexp *
fscanf*
MATH.H
STDIO.H
fseek*
fsetpos
ftell*
STDIO.H
STDIO.H
STDIO.H
fwrite *
getc*
STDIO.H
STDIO.H
getch*
getchar*
getche *
STDIO.H
STDIO.H
STDIO.H
int getch(void);
int getchar(void);
int getche(void);
getenv
gets*
STDLIB.H
STDIO.H
gmtime
isalnum *
isalpha *
TIME.H
CTYPE.H
CTYPE.H
isascii*
iscntrl*
CTYPE.H
CTYPE.H
int isascii(int);
int iscntrl(int);
isdigit*
isgraph*
islower*
CTYPE.H
CTYPE.H
CTYPE.H
int isdigit(int);
int isgraph(int);
int islower(int);
isprint*
CTYPE.H
int isprint(int);
423
ispunct*
isspace*
CTYPE.H
CTYPE.H
int ispunct(int);
int isspace(int);
isupper*
isxdigit*
CTYPE.H
CTYPE.H
int isupper(int);
int isxdigit(int);
labs
ldexp
ldiv
STDLIB.H
MATH.H
STDLIB.H
localtime* TIME.H
log*
MATH.H
log10*
malloc*
mblen
double log10(double);
void *malloc(size_t);
int mblen(const char *, size_t);
MATH.H
STDLIB.H
STDLIB.H
mbstowcs STDLIB.H
mbtowc
STDLIB.H
memchr
STRING.H
memcmp STRING.H
memcpy STRING.H
memmove STRING.H
memset
STRING.H
mktime*
modf
perror*
TIME.H
MATH.H
STDIO.H
pow*
printf*
MATH.H
STDIO.H
putc*
putchar*
puts*
STDIO.H
STDIO.H
STDIO.H
qsort*
rand
STDLIB.H
STDLIB.H
void qsort(void*, size_t, size_t, int (*)(const void*, const void *));
int rand(void);
realloc*
remove *
rename*
STDLIB.H
STDIO.H
STDIO.H
rewind *
scanf*
STDIO.H
STDIO.H
setbuf
setvbuf
sin*
STDIO.H
STDIO.H
MATH.H
sinh*
MATH.H
double sinh(double);
424
sleep*
sprintf
TIME.H
STDIO.H
void sleep(time_t);
int sprintf(char *, const char *, ...);
sqrt*
srand
MATH.H
STDLIB.H
double sqrt(double);
void srand(unsigned);
sscanf
strcat*
strchr *
STDIO.H
STRING.H
STRING.H
strcmp*
strcmpl*
STRING.H
STRING.H
strcpy*
strcspn*
strdup *
STRING.H
STRING.H
STRING.H
strerror
strftime*
STRING.H
TIME.H
char *strerror(int);
size_t strftime(char *, size_t, const char *, const struct tm *);
strlen*
strlwr*
strncat*
STRING.H
STRING.H
STRING.H
strncmp*
strncpy*
STRING.H
STRING.H
strnset*
strpbrk*
strrchr *
STRING.H
STRING.H
STRING.H
strspn*
strstr*
STRING.H
STRING.H
strtod
strtok
strtol
STDLIB.H
STRING.H
STDLIB.H
strtoul
strupr*
STDLIB.H
STRING.H
system*
tan*
tanh*
STDLIB.H
MATH.H
MATH.H
time*
tmpfile
TIME.H
STDIO.H
tmpnam*
tolower
toupper
STDIO.H
CTYPE.H
CTYPE.H
ungetc*
STDIO.H
va_arg*
va_end *
va_start*
vfprintf
vprintf
STDIO.H
vsprintf
STDIO.H
wcstombs STDLIB.H
wctomb
STDLIB.H
426