0% found this document useful (0 votes)
185 views

Standard C Library Functions Table

This document provides a summary of standard C library functions in alphabetical order. It lists the function name, include file, function prototype, and brief description for each function. Some key functions summarized include abort(), abs(), atoi(), calloc(), ceil(), clock(), cos(), difftime(), exit(), exp(), floor(), fopen(), free(), getchar(), labs(), log(), malloc(), printf(), rand(), scanf(), sin(), sqrt(), srand(), strcat(), strcmp(), strcpy(), strlen(), time(), and others.

Uploaded by

ANU
Copyright
© © All Rights Reserved
Available Formats
Download as PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
185 views

Standard C Library Functions Table

This document provides a summary of standard C library functions in alphabetical order. It lists the function name, include file, function prototype, and brief description for each function. Some key functions summarized include abort(), abs(), atoi(), calloc(), ceil(), clock(), cos(), difftime(), exit(), exp(), floor(), fopen(), free(), getchar(), labs(), log(), malloc(), printf(), rand(), scanf(), sin(), sqrt(), srand(), strcat(), strcmp(), strcpy(), strlen(), time(), and others.

Uploaded by

ANU
Copyright
© © All Rights Reserved
Available Formats
Download as PDF, TXT or read online on Scribd
You are on page 1/ 22

Standard C Library Functions Table, By

Name
Last Updated: 2023-04-11

This table briefly describes the C library functions, listed in alphabetical order. This table provides the include file
name and the function prototype for each function.

Table 1. Standard C Library Functions

System
Function Include Function Prototype Description
File

abort stdlib.h void abort(void); Stops a program abnormally.

Calculates the absolute value


abs stdlib.h int abs(int n);
of an integer argument n.

acos math.h double acos(double x); Calculates the arc cosine of x.

Converts the time that is stored


char *asctime(const struct tm
asctime time.h as a structure to a character
*time);
string.
Converts tm that is stored as a
char *asctime_r (const struct tm structure to a character string.
asctime_r time.h
*tm, char *buf); (Restartable version of
asctime.)

asin math.h double asin(double x); Calculates the arc sine of x.

Prints a diagnostic message


assert assert.h void assert(int expression); and ends the program if the
expression is false.

atan math.h double atan(double x); Calculates the arc tangent of x.

Calculates the arc tangent


atan2 math.h double atan2(double y, double x);
of y/x.
Registers a function to be
atexit stdlib.h int atexit(void (*func)(void));
called at normal termination.
Converts string to a double-
atof stdlib.h double atof(const char *string);
precision floating-point value.

atoi stdlib.h int atoi(const char *string); Converts string to an integer.


System
Function Include Function Prototype Description
File
Converts string to a long
atol stdlib.h long int atol(const char *string);
integer.
Performs a binary search on an
void *bsearch(const void *key,
array of num elements, each
const void *base, size_t num,
of size bytes. The array must
bsearch stdlib.h size_t size, int (*compare) (const
be sorted in ascending order by
void *element1, const void
the function pointed to
*element2));
by compare.
Determines
stdio.h whether c constitues a valid
btowc wint_t btowc(int c);
wchar.h multibyte character in the initial
shift state.
Reserves storage space for an
void *calloc(size_t num, array of num elements, each of
calloc stdlib.h
size_t size); size size, and initializes the
values of all elements to 0.
Closes a previously opened
catclose6 nl_types.h int catclose (nl_catd catd);
message catalog.
char *catgets(nl_catd catd, int Retrieves a message from an
catgets6 nl_types.h
set_id, int msg_id, const char *s); open message catalog.
Opens a message catalog,
nl_catd catopen (const char *name,
catopen6 nl_types.h which must be done before a
int oflag);
message can be retrieved.
Calculates the double value
representing the smallest
ceil math.h double ceil(double x);
integer that is greater than or
equal to x.
Resets the error indicators and
clearerr stdio.h void clearerr(FILE *stream); the end-of-file indicator
for stream.
Returns the processor time that
clock time.h clock_t clock(void); has elapsed since the job was
started.

cos math.h double cos(double x); Calculates the cosine of x.

Calculates the hyperbolic


cosh math.h double cosh(double x);
cosine of x.
Converts time to a character
ctime time.h char *ctime(const time_t *time);
string.
char *ctime64(const time64_t Converts time to a character
ctime64 time.h
*time); string.
System
Function Include Function Prototype Description
File
Converts time to a character
char *ctime_r(const time_t *time,
ctime_r time.h string. (Restartable version of
char *buf);
ctime.)
Converts time to a character
char *ctime64_r(const time64_t
ctime64_r time.h string. (Restartable version of
*time, char *buf);
ctime64.)
double difftime(time_t time2, Computes the difference
difftime time.h
time_t time1); between time2 and time1.
double difftime64(time64_t time2, Computes the difference
difftime64 time.h
time64_t time1); between time2 and time1.
Calculates the quotient and
div_t div(int numerator,
div stdlib.h remainder of the division
int denominator);
of numerator by denominator.
Calculates the error function
erf math.h double erf(double x);
of x.
Calculates the error function for
erfc math.h double erfc(double x);
large values of x.

exit stdlib.h void exit(int status); Ends a program normally.

Calculates the exponential


exp math.h double exp(double x); function of a floating-point
argument x.
Calculates the absolute value
fabs math.h double fabs(double x);
of a floating-point argument x.

fclose stdio.h int fclose(FILE *stream); Closes the specified stream.

Associates an input or output


FILE *fdopen(int handle, const
fdopen5 stdio.h stream with the file identified by
char *type);
handle.
Tests whether the end-of-file
feof stdio.h int feof(FILE *stream);
flag is set for a given stream.
Tests for an error indicator in
ferror stdio.h int ferror(FILE *stream); reading from or writing
to stream.
Writes the contents of the
fflush1 stdio.h int fflush(FILE *stream); buffer associated with the
output stream.
Reads a single unsigned
fgetc1 stdio.h int fgetc(FILE *stream); character from the
input stream.
System
Function Include Function Prototype Description
File
Stores the current position of
int fgetpos(FILE *stream, fpos_t the file pointer associated
fgetpos1 stdio.h
*pos); with stream into the object
pointed to by pos.
char *fgets(char *string, int n, FILE Reads a string from the
fgets1 stdio.h
*stream); input stream.
Reads the next multibyte
stdio.h
fgetwc6 wint_t fgetwc(FILE *stream); character from the input stream
wchar.h
pointed to by stream.
Reads wide characters from the
stdio.h wchar_t *fgetws(wchar_t *wcs,
fgetws6 stream into the array pointed to
wchar.h int n, FILE *stream);
by wcs.
Determines the file handle
fileno5 stdio.h int fileno(FILE *stream); currently associated
with stream.
Calculates the floating-point
floor math.h double floor(double x); value representing the largest
integer less than or equal to x.
Calculates the floating-point
fmod math.h double fmod(double x, double y);
remainder of x/y.
FILE *fopen(const char *filename,
fopen stdio.h Opens the specified file.
const char *mode);
Formats and prints characters
int fprintf(FILE *stream, const char
fprintf stdio.h and values to the
*format-string, arg-list);
output stream.
Prints a character to the
fputc1 stdio.h int fputc(int c, FILE *stream);
output stream.
int fputs(const char *string, FILE Copies a string to the
fputs1 stdio.h
*stream); output stream.
Converts the wide
character wc to a multibyte
stdio.h wint_t fputwc(wchar_t wc, character and writes it to the
fputwc6
wchar.h FILE *stream); output stream pointed to
by stream at the current
position.
Converts the wide-character
string wcs to a multibyte-
stdio.h int fputws(const wchar_t *wcs,
fputws6 character string and writes it
wchar.h FILE *stream);
to stream as a multibyte
character string.
System
Function Include Function Prototype Description
File
Reads up to count items
size_t fread(void *buffer,
of size length from the
fread stdio.h size_t size, size_t count, FILE
input stream, and stores them
*stream);
in buffer.

free stdlib.h void free(void *ptr); Frees a block of storage.

FILE *freopen(const char


Closes stream, and reassigns it
freopen stdio.h *filename, const char *mode, FILE
to the file specified.
*stream);
Separates a floating-point
frexp math.h double frexp(double x, int *expptr); number into its mantissa and
exponent.
int fscanf(FILE *stream, const char Reads data from stream into
fscanf stdio.h
*format-string, arg-list); locations given by arg-list.
Changes the current file
int fseek(FILE *stream, long
fseek1 stdio.h position associated
int offset, int origin);
with stream to a new location.
Moves the current file position
int fsetpos(FILE *stream, const
fsetpos1 stdio.h to a new location determined
fpos_t *pos);
by pos.
Gets the current position of the
ftell1 stdio.h long int ftell(FILE *stream);
file pointer.
Determines the orientation of
stdio.h
fwide6 int fwide(FILE *stream, int mode); the stream pointed to
wchar.h
by stream.
stdio.h int fwprintf(FILE *stream, const Writes output to the stream
fwprintf6
wchar.h wchar_t *format, arg-list); pointed to by stream.
size_t fwrite(const void *buffer, Writes up to count items
fwrite stdio.h size_t size,size_t count, FILE of size length
*stream); from buffer to stream.
stdio.h int fwscanf(FILE *stream, const Reads input from the stream
fwscanf6
wchar.h wchar_t *format, arg-list) pointed to by stream.
Computes the Gamma
gamma math.h double gamma(double x);
Function
Reads a single character from
getc1 stdio.h int getc(FILE *stream);
the input stream.
Reads a single character
getchar1 stdio.h int getchar(void);
from stdin.
Searches environment
getenv stdlib.h char *getenv(const char *varname);
variables for varname.
System
Function Include Function Prototype Description
File
Reads a string from stdin, and
gets stdio.h char *gets(char *buffer);
stores it in buffer.
Reads the next multibyte
character from stream, converts
stdio.h
getwc6 wint_t getwc(FILE *stream); it to a wide character and
wchar.h
advances the associated file
position indicator for stream.
Reads the next multibyte
character from stdin, converts it
getwchar6 wchar.h wint_t getwchar(void); to a wide character, and
advances the associated file
position indicator for stdin.
struct tm *gmtime(const time_t Converts a time value to a
gmtime time.h
*time); structure of type tm.
struct tm *gmtime64(const time64_t Converts a time value to a
gmtime64 time.h
*time); structure of type tm.
Converts a time value to a
struct tm *gmtime_r (const time_t structure of type tm.
gmtime_r time.h
*time, struct tm *result); (Restartable version of
gmtime.)
Converts a time value to a
struct tm *gmtime64_r (const structure of type tm.
gmtime64_r time.h
time64_t *time, struct tm *result); (Restartable version of
gmtime64.)
Calculates the hypotenuse of a
double hypot(double side1,
hypot math.h right-angled triangle with sides
double side2);
of length side1 and side2.

isalnum ctype.h int isalnum(int c); Tests if c is alphanumeric.

isalpha ctype.h int isalpha(int c); Tests if c is alphabetic.

Tests if c is within the 7-bit US-


isascii4 ctype.h int isascii(int c);
ASCII range.
Tests if c is a blank or tab
isblank ctype.h int isblank(int c);
character.

iscntrl ctype.h int iscntrl(int c); Tests if c is a control character.

isdigit ctype.h int isdigit(int c); Tests if c is a decimal digit.

Tests if c is a printable
isgraph ctype.h int isgraph(int c);
character excluding the space.
System
Function Include Function Prototype Description
File

islower ctype.h int islower(int c); Tests if c is a lowercase letter.

Tests if c is a printable
isprint ctype.h int isprint(int c);
character including the space.
Tests if c is a punctuation
ispunct ctype.h int ispunct(int c);
character.
Tests if c is a whitespace
isspace ctype.h int isspace(int c);
character.

isupper ctype.h int isupper(int c); Tests if c is an uppercase letter.

Checks for any alphanumeric


iswalnum4 wctype.h int iswalnum (wint_t wc);
wide character.
Checks for any alphabetic wide
iswalpha4 wctype.h int iswalpha (wint_t wc);
character.
Checks for any blank or tab
iswblank4 wctype.h int iswblank (wint_t wc);
wide character.
Tests for any control wide
iswcntrl4 wctype.h int iswcntrl (wint_t wc);
character.
Determines whether or not the
int iswctype(wint_t wc, wctype_t
iswctype4 wctype.h wide character wc has the
wc_prop);
property wc_prop.
Checks for any decimal-digit
iswdigit4 wctype.h int iswdigit (wint_t wc);
wide character.
Checks for any printing wide
iswgraph4 wctype.h int iswgraph (wint_t wc); character except for the wide-
character space.
Checks for any lowercase wide
iswlower4 wctype.h int iswlower (wint_t wc);
character.
Checks for any printing wide
iswprint4 wctype.h int iswprint (wint_t wc);
character.
Test for a wide non-
iswpunct4 wctype.h int iswpunct (wint_t wc); alphanumeric, non-space
character.
Checks for any wide character
that corresponds to an
iswspace4 wctype.h int iswspace (wint_t wc); implementation-defined set of
wide characters for which
iswalnum is false.
Checks for any uppercase wide
iswupper4 wctype.h int iswupper (wint_t wc);
character.
System
Function Include Function Prototype Description
File
Checks for any hexadecimal
iswxdigit4 wctype.h int iswxdigit (wint_t wc);
digit character.

isxdigit4 wctype.h int isxdigit(int c); Tests if c is a hexadecimal digit.

Calculates the Bessel function


j0 math.h double j0(double x);
value of the first kind of order 0.
Calculates the Bessel function
j1 math.h double j1(double x);
value of the first kind of order 1.
Calculates the Bessel function
jn math.h double jn(int n, double x);
value of the first kind of order n.
Calculates the absolute value
labs stdlib.h long int labs(long int n);
of n.
Returns the value
ldexp math.h double ldexp(double x, int exp); of x multiplied by (2 to the
power of exp).
Calculates the quotient and
ldiv_t ldiv(long int numerator, long
ldiv stdlib.h remainder
int denominator);
of numerator/denominator.
Formats numeric quantities in
localeconv locale.h struct lconv *localeconv(void); struct lconv according to the
current locale.
struct tm *localtime(const time_t Converts timeval to a structure
localtime time.h
*timeval); of type tm.
struct tm *localtime64(const Converts timeval to a structure
localtime64 time.h
time64_t *timeval); of type tm.
Converts a time value to a
struct tm *localtime_r (const time_t structure of type tm.
localtime_r time.h
*timeval, struct tm *result); (Restartable version of
localtime.)
Converts a time value to a
struct tm *localtime64_r (const structure of type tm.
localtime64_r time.h
time64_t *timeval, struct tm *result); (Restartable version of
localtime64.)
Calculates the natural logarithm
log math.h double log(double x);
of x.
Calculates the base 10
log10 math.h double log10(double x);
logarithm of x.
Restores a stack environment
void longjmp(jmp_buf env,
longjmp setjmp.h previously set in env by the
int value);
setjmp function.
malloc stdlib.h void *malloc(size_t size); Reserves a block of storage.
System
Function Include Function Prototype Description
File

int mblen(const char *string, Determines the length of a


mblen stdlib.h
size_t n); multibyte character string.
Determines the length of a
int mbrlen (const char *s, size_t n,
mbrlen4 wchar.h multibyte character.
mbstate_t *ps);
(Restartable version of mblen.)
Convert a multibyte character
int mbrtowc (wchar_t *pwc, const to a wide character
mbrtowc4 wchar.h
char *s, size_t n, mbstate_t *ps); (Restartable version of
mbtowc.)
Test state object *ps for initial
mbsinit4 wchar.h int mbsinit (const mbstate_t *ps);
state.
Convert multibyte string to a
size_t mbsrtowc (wchar_t *dst,
wide character string.
mbsrtowcs4 wchar.h const char **src, size_t len,
(Restartable version of
mbstate_t *ps);
mbstowcs.)
Converts the multibyte
characters in string to their
size_t mbstowcs(wchar_t *pwc,
mbstowcs stdlib.h corresponding wchar_t codes,
const char *string, size_t n);
and stores not more
than n codes in pwc.
Stores the wchar_t code
corresponding to the
int mbtowc(wchar_t *pwc, const
mbtowc stdlib.h first n bytes of multibyte
char *string, size_t n);
character string into the
wchar_t character pwc.
Searches the first count bytes
void *memchr(const void *buf, int c, of buf for the first occurrence
memchr string.h
size_t count); of c converted to an unsigned
character.
int memcmp(const void *buf1, Compares up to count bytes
memcmp string.h
const void *buf2, size_t count); of buf1 and buf2.
void *memcpy(void *dest, const Copies count bytes
memcpy string.h
void *src, size_t count); of src to dest.
Copies count bytes
void *memmove(void *dest, const
memmove string.h of src to dest. Allows copying
void *src, size_t count);
between objects that overlap.
void *memset(void *dest, int c, Sets count bytes of dest to a
memset string.h
size_t count); value c.
Converts local time into
mktime time.h time_t mktime(struct tm *time);
calendar time.
System
Function Include Function Prototype Description
File
Converts local time into
mktime64 time.h time64_t mktime64(struct tm *time);
calendar time.
Breaks down the floating-point
double modf(double x, double
modf math.h value x into fractional and
*intptr);
integral parts.
Calculates the next
double nextafter(double x,
nextafter math.h representable value after x in
double y);
the direction of y.
Calculates the next
long double nextafterl(long
nextafterl math.h representable value after x in
double x, long double y);
the direction of y.
Calculates the next
double nexttoward(double x, long
nexttoward math.h representable value after x in
double y);
the direction of y.
Calculates the next
long double nexttowardl(long
nexttowardl math.h representable value after x in
double x, long double y);
the direction of y.
Retrieve from the current locale
the string that describes the
nl_langinfo4 langinfo.h char *nl_langinfo(nl_item item);
requested information specified
by item.
Prints an error message to
perror stdio.h void perror(const char *string);
stderr.
Calculates the value x to the
pow math.h double pow(double x, double y);
power y.
int printf(const char *format- Formats and prints characters
printf stdio.h
string, arg-list); and values to stdout.

putc1 stdio.h int putc(int c, FILE *stream); Prints c to the output stream.

putchar1 stdio.h int putchar(int c); Prints c to stdout.

Sets the value of an


environment variable by
putenv stdlib.h int *putenv(const char *varname);
altering an existing variable or
creating a new one.

puts stdio.h int puts(const char *string); Prints a string to stdout.

Converts the wide


stdio.h wint_t putwchar(wchar_t wc, character wc to a multibyte
putwc6
wchar.h FILE *stream); character, and writes it to the
stream at the current position.
System
Function Include Function Prototype Description
File
Converts the wide
character wc to a multibyte
putwchar6 wchar.h wint_t putwchar(wchar_t wc);
character and writes it to
stdout.
void qsort(void *base, size_t num,
Performs a quick sort of an
size_t width, int(*compare)(const
qsort stdlib.h array of num elements, each
void *element1, const void
of width bytes in size.
*element2));
_Decimal32 Compute the quantum
quantexpd32 math.h quantized32(_Decimal32 x, exponent of a single-precision
_Decimal32 y); decimal floating-point value.
_Decimal64 Compute the quantum
quantexpd64 math.h quantized64(_Decimal64 x, exponent of a double-precision
_Decimal64 y); decimal floating-point value.
_Decimal128 Compute the quantum
quantexpd128 math.h quantized128(_Decimal128 x, exponent of a quad-precision
_Decimal128 y); decimal floating-point value.
Set the quantum exponent of a
single-precision decimal
floating-point value to the
quantized32 math.h int quantexpd32(_Decimal32 x);
quantum exponent of another
single-precision decimal
floating-point value.
Set the quantum exponent of a
double-precision decimal
floating-point value to the
quantized64 math.h int quantexpd64(_Decimal64 x);
quantum exponent of another
double-precision decimal
floating-point value.
Set the quantum exponent of a
quad-precision decimal floating-
point value to the quantum
quantized128 math.h int quantexpd128(_Decimal128 x);
exponent of another quad-
precision decimal floating-point
value.
Determine if the quantum
__bool__
exponents of two single-
samequantumd32 math.h samequantumd32(_Decimal32 x,
precision decimal floating-point
_Decimal32 y);
values are the same.
samequantumd64 math.h __bool__ Determine if the quantum
samequantumd64(_Decimal64 x, exponents of two double-
System
Function Include Function Prototype Description
File
_Decimal64 y); precision decimal floating-point
values are the same.
Determine if the quantum
__bool__
exponents of two quad-
samequantumd128 math.h samequantumd128(_Decimal128 x,
precision decimal floating-point
_Decimal128 y);
values are the same.
Sends the signal sig to the
raise signal.h int raise(int sig);
running program.
Returns a pseudo-random
rand stdlib.h int rand(void);
integer.
Returns a pseudo-random
rand_r stdlib.h int rand_r(void);
integer. (Restartable version)
Changes the size of a
realloc stdlib.h void *realloc(void *ptr, size_t size); previously reserved storage
block.
Compiles the source regular
expression pointed to
int regcomp(regex_t *preg, const
regcomp regex.h by pattern into an executable
char *pattern, int cflags);
version and stores it in the
location pointed to by preg.
size_t regerror(int errcode, const Finds the description for the
regerror regex.h regex_t *preg, char *errbuf, error code errcode for the
size_t errbuf_size); regular expression preg.
Compares the null-ended
int regexec(const regex_t *preg, string string against the
regexec regex.h const char *string, size_t nmatch, compiled regular
regmatch_t *pmatch, int eflags); expression preg to find a match
between the two.
Frees any memory that was
allocated by regcomp to
regfree regex.h void regfree(regex_t *preg);
implement the regular
expression preg.
Deletes the file specified
remove stdio.h int remove(const char *filename);
by filename.
int rename(const char *oldname,
rename stdio.h Renames the specified file.
const char *newname);
Repositions the file pointer
rewind1 stdio.h void rewind(FILE *stream); associated with stream to the
beginning of the file.
int scanf(const char *format- Reads data from stdin into
scanf stdio.h
string, arg-list); locations given by arg-list.
System
Function Include Function Prototype Description
File
void setbuf(FILE *stream, char
setbuf stdio.h Controls buffering for stream.
*buffer);
Saves a stack environment that
setjmp setjmp.h int setjmp(jmp_buf env); can be subsequently restored
by longjmp.
char *setlocale(int category, const Changes or queries variables
setlocale locale.h
char *locale); defined in the locale.
int setvbuf(FILE *stream, char *buf, Controls buffering and
setvbuf stdio.h
int type, size_t size); buffer size for stream.
void(*signal (int sig, void(*func) Registers func as a signal
signal signal.h
(int))) (int); handler for the signal sig.

sin math.h double sin(double x); Calculates the sine of x.

Calculates the hyperbolic sine


sinh math.h double sinh(double x);
of x.
Same as sprintf except that the
int snprintf(char *outbuf, size_t n, function will stop after n
snprintf stdio.h
const char*, ...) characters have been written to
outbuf.
int sprintf(char *buffer, const char Formats and stores characters
sprintf stdio.h
*format-string, arg-list); and values in buffer.

sqrt math.h double sqrt(double x); Calculates the square root of x.

Sets the seed for the pseudo-


srand stdlib.h void srand(unsigned int seed);
random number generator.
int sscanf(const char *buffer, const Reads data from buffer into the
sscanf stdio.h
char *format, arg-list); locations given by arg-list.
int srtcasecmp(const char *string1, Compares strings without case
strcasecmp strings.h
const char *string2); sensitivity.
char *strcat(char *string1, const
strcat string.h Concatenates string2 to string1.
char *string2);
char *strchr(const char *string, Locates the first occurrence
strchr string.h
int c); of c in string.
int strcmp(const char *string1, Compares the value
strcmp string.h
const char *string2); of string1 to string2.
Compares two strings using the
int strcoll(const char *string1, const
strcoll string.h collating sequence in the
char *string2);
current locale.
char *strcpy(char *string1, const
strcpy string.h Copies string2 into string1.
char *string2);
System
Function Include Function Prototype Description
File
Returns the length of the initial
size_t strcspn(const char *string1, substring of string1 consisting
strcspn string.h
const char *string2); of characters not contained
in string2.
Maps the error number
strerror string.h char *strerror(int errnum); in errnum to an error message
string.
int strfmon (char *s, size_t maxsize, Converts monetary value to
strfmon4 wchar.h
const char *format, ...); string.
size_t strftime (char *dest, Stores characters in an array
strftime time.h size_t maxsize, const char *format, pointed to by dest, according to
const struct tm *timeptr); the string determined by format.

strlen string.h size_t strlen(const char *string); Calculates the length of string.

int strncasecmp(const char


Compares strings without case
strncasecmp strings.h *string1, const char *string2, size_t
sensitivity.
count);
Concatenates up
char *strncat(char *string1, const
strncat string.h to count characters
char *string2, size_t count);
of string2 to string1.
Compares up
int strncmp(const char *string1,
strncmp string.h to count characters
const char *string2, size_t count);
of string1 and string2.
char *strncpy(char *string1, const Copies up to count characters
strncpy string.h
char *string2, size_t count); of string2 to string1.
Locates the first occurrence
char *strpbrk(const char *string1,
strpbrk string.h in string1 of any character
const char *string2);
in string2.
char *strptime (const char *buf,
strptime4 time.h Date and time conversion
const char *format, struct tm *tm);
char *strrchr(const char *string, Locates the last occurrence
strrchr string.h
int c); of c in string.
Returns the length of the initial
size_t strspn(const char *string1, substring of string1 consisting
strspn string.h
const char *string2); of characters contained
in string2.
char *strstr(const char *string1, Returns a pointer to the first
strstr string.h
const char *string2); occurrence of string2 in string1.
double strtod(const char *nptr, char Converts nptr to a double
strtod stdlib.h
**endptr); precision value.
System
Function Include Function Prototype Description
File
Converts nptr to a single-
_Decimal32 strtod32(const char
strtod32 stdlib.h precision decimal floating-point
*nptr, char **endptr);
value.
Converts nptr to a double-
_Decimal64 strtod64(const char
strtod64 stdlib.h precision decimal floating-point
*nptr, char **endptr);
value.
Converts nptr to a quad-
_Decimal128 strtod128(const char
strtod128 stdlib.h precision decimal floating-point
*nptr, char **endptr);
value.
float strtof(const char *nptr, char
strtof stdlib.h Converts nptr to a float value.
**endptr);
Locates the next token
char *strtok(char *string1, const
strtok string.h in string1 delimited by the next
char *string2);
character in string2.
Locates the next token
char *strtok_r(char *string, const in string delimited by the next
strtok_r string.h
char *seps, char **lasts); character in seps. (Restartable
version of strtok.)
long int strtol(const char *nptr, char Converts nptr to a signed long
strtol stdlib.h
**endptr, int base); integer.
long double strtold(const char *nptr, Converts nptr to a long double
strtold stdlib.h
char **endptr); value.
unsigned long int strtoul(const char Converts string1 to an unsigned
strtoul stdlib.h
*string1, char **string2, int base); long integer.
Converts string2 and places the
size_t strxfrm(char *string1, const result in string1. The
strxfrm string.h
char *string2, size_t count); conversion is determined by the
program's current locale.
Formats and stores a series of
int swprintf(wchar_t *wcsbuffer,
wide characters and values into
swprintf wchar.h size_t n, const
the wide-character
wchar_t *format, arg-list);
buffer wcsbuffer.
int swscanf (const wchar_t *buffer, Reads data from buffer into the
swscanf wchar.h
const wchar_t *format, arg-list) locations given by arg-list.
Passes string to the system
system stdlib.h int system(const char *string);
command analyzer.

tan math.h double tan(double x); Calculates the tangent of x.

Calculates the hyperbolic


tanh math.h double tanh(double x);
tangent of x.
System
Function Include Function Prototype Description
File
Returns the current calendar
time time.h time_t time(time_t *timeptr);
time.
Returns the current calendar
time64 time.h time64_t time64(time64_t *timeptr);
time.
Creates a temporary binary file
tmpfile stdio.h FILE *tmpfile(void);
and opens it.
Generates a temporary file
tmpnam stdio.h char *tmpnam(char *string);
name.
Converts c to a character in the
toascii ctype.h int toascii(int c);
7-bit US-ASCII character set.

tolower ctype.h int tolower(int c); Converts c to lowercase.

toupper ctype.h int toupper(int c); Converts c to uppercase.

Translates the wide


wint_t towctrans(wint_t wc,
towctrans wctype.h character wc based on the
wctrans_t desc);
mapping described by desc.
Converts uppercase letter to
towlower4 wctype.h wint_t towlower (wint_t wc);
lowercase letter.
Converts lowercase letter to
towupper4 wctype.h wint_t towupper (wint_t wc);
uppercase letter.
Pushes c back onto the
ungetc1 stdio.h int ungetc(int c, FILE *stream);
input stream.
Pushes the wide
stdio.h wint_t ungetwc(wint_t wc,
ungetwc6 character wc back onto the
wchar.h FILE *stream);
input stream.
Returns the value of one
var_type va_arg(va_list arg_ptr, argument and
va_arg stdarg.h
var_type); modifies arg_ptr to point to the
next argument.
void va_copy(va_list dest,
va_copy stdarg.h Initializes dest as a copy of src.
va_list src);
Facilitates normal return from
va_end stdarg.h void va_end(va_list arg_ptr); variable argument list
processing.
Initializes arg_ptr for
void va_start(va_list arg_ptr,
va_start stdarg.h subsequent use
variable_name);
by va_arg and va_end.
Formats and prints characters
stdio.h int vfprintf(FILE *stream, const char
vfprintf to the output stream using a
stdarg.h *format, va_list arg_ptr);
variable number of arguments.
System
Function Include Function Prototype Description
File
Reads data from a specified
stdio.h int vfscanf(FILE *stream, const
vfscanf stream into locations given by a
stdarg.h char *format, va_list arg_ptr);
variable number of arguments.
stdarg.h Equivalent to fwprintf, except
int vfwprintf(FILE *stream, const
vfwprintf6 stdio.h that the variable argument list is
wchar_t *format, va_list arg);
wchar.h replaced by arg.
Reads wide data from a
stdio.h int vfwscanf(FILE *stream, const specified stream into locations
vfwscanf
stdarg.h wchar_t *format, va_list arg_ptr); given by a variable number of
arguments.
Formats and prints characters
stdio.h int vprintf(const char *format,
vprintf to stdout using a variable
stdarg.h va_list arg_ptr);
number of arguments.
Reads data from stdin into
stdio.h int vscanf(const
vscanf locations given by a variable
stdarg.h char *format, va_list arg_ptr);
number of arguments.
Formats and stores characters
stdio.h int vsprintf(char *target-string, const
vsprintf in a buffer using a variable
stdarg.h char *format, va_list arg_ptr);
number of arguments.
Same as vsprintf except that
int vsnprintf(char *outbuf, size_t n, the function will stop after n
vsnprintf stdio.h
const char*, va_list); characters have been written to
outbuf.
Reads data from a buffer into
stdio.h int vsscanf(const char*buffer, const
vsscanf locations given by a variable
stdarg.h char *format, va_list arg_ptr);
number of arguments.
int vswprintf(wchar_t *wcsbuffer, Formats and stores a series of
stdarg.h
vswprintf size_t n, const wide characters and values in
wchar.h
wchar_t *format, va_list arg); the buffer wcsbuffer.
int vswscanf(const wchar_t *buffer, Reads wide data from a buffer
stdio.h
vswscanf const wchar_t *format, va_list into locations given by a
wchar.h
arg_ptr); variable number of arguments.
Equivalent to wprintf, except
stdarg.h int vwprintf(const
vwprintf6 that the variable argument list is
wchar.h wchar_t *format, va_list arg);
replaced by arg.
Reads wide data from stdin into
stdio.h int vwscanf(const
vwscanf locations given by a variable
wchar.h wchar_t *format, va_list arg_ptr);
number of arguments.
wcrtomb4 wchar.h int wcrtomb (char *s, wchar_t Converts a wide character to a
wchar, mbstate_t *pss); multibyte character.
System
Function Include Function Prototype Description
File
(Restartable version of
wctomb.)
Appends a copy of the string
wchar_t *wcscat(wchar_t *string1, pointed to by string2 to the end
wcscat wchar.h
const wchar_t *string2); of the string pointed to
by string1.
Searches the wide-character
wchar_t *wcschr(const
wcschr wchar.h string pointed to by string for
wchar_t *string, wchar_t character);
the occurrence of character.
int wcscmp(const wchar_t *string1, Compares two wide-character
wcscmp wchar.h
const wchar_t *string2); strings, *string1 and *string2.
Compares two wide-character
int wcscoll (const wchar_t *wcs1,
wcscoll4 wchar.h strings using the collating
const wchar_t *wcs2);
sequence in the current locale.
Copies the contents
wchar_t *wcscpy(wchar_t *string1, of *string2 (including the ending
wcscpy wchar.h
const wchar_t *string2); wchar_t null character)
into *string1.
Determines the number of
wchar_t characters in the initial
size_t wcscspn(const
segment of the string pointed to
wcscspn wchar.h wchar_t *string1, const
by *string1 that do not appear
wchar_t *string2);
in the string pointed to
by *string2.
size_t wcsftime(wchar_t *wdest, Converts the time and date
size_t maxsize, const specification in
wcsftime wchar.h
wchar_t *format, const struct the timeptr structure into a
tm *timeptr); wide-character string.
Computes the number of wide-
size_t wcslen(const
wcslen wchar.h characters in the string pointed
wchar_t *string);
to by string.
Formats numeric quantities
struct wcslconv
wcslocaleconv locale.h in struct wcslconv according to
*wcslocaleconv(void);
the current locale.
Appends up to count wide
wchar_t *wcsncat(wchar_t *string1, characters from string2 to the
wcsncat wchar.h const wchar_t *string2, end of string1, and appends a
size_t count); wchar_t null character to the
result.
wcsncmp wchar.h int wcsncmp(const Compares up to count wide
wchar_t *string1, const characters in string1 to string2.
System
Function Include Function Prototype Description
File
wchar_t *string2, size_t count);
wchar_t *wcsncpy(wchar_t *string1, Copies up to count wide
wcsncpy wchar.h const wchar_t *string2, characters
size_t count); from string2 to string1.
Locates the first occurrence in
wchar_t *wcspbrk(const the string pointed to
wcspbrk wchar.h wchar_t *string1, const by string1 of any wide
wchar_t *string2); characters from the string
pointed to by string2.
wchar_t *wcsptime ( const wchar_t Date and time conversion.
wcsptime wchar.h *buf, const wchar_t *format, struct Equivalent to strptime(), except
tm *tm ); that it uses wide characters.
Locates the last occurrence
wchar_t *wcsrchr(const
wcsrchr wchar.h of character in the string
wchar_t *string, wchar_t character);
pointed to by string.
size_t wcsrtombs (char *dst, const Converts wide character string
wcsrtombs4 wchar.h wchar_t **src, size_t len, mbstate_t to multibyte string. (Restartable
*ps); version of wcstombs.)
Computes the number of wide
characters in the initial segment
size_t wcsspn(const
of the string pointed to
wcsspn wchar.h wchar_t *string1, const
by string1, which consists
wchar_t *string2);
entirely of wide characters from
the string pointed to by string2.
wchar_t *wcsstr(const
Locates the first occurrence
wcsstr wchar.h wchar_t *wcs1, const
of wcs2 in wcs1.
wchar_t *wcs2);
Converts the initial portion of
double wcstod(const wchar_t *nptr, the wide-character string
wcstod wchar.h
wchar_t **endptr); pointed to by nptr to a double
value.
Converts the initial portion of
the wide-character string
_Decimal32 wcstod32(const
wcstod32 wchar.h pointed to by nptr to a single-
wchar_t *nptr, wchar_t **endptr);
precision decimal floating-point
value.
Converts the initial portion of
the wide-character string
_Decimal64 wcstod64(const
wcstod64 wchar.h pointed to by nptr to a double-
wchar_t *nptr, wchar_t **endptr);
precision decimal floating-point
value.
System
Function Include Function Prototype Description
File
Converts the initial portion of
the wide-character string
_Decimal128 wcstod128(const
wcstod128 wchar.h pointed to by nptr to a quad-
wchar_t *nptr, wchar_t **endptr);
precision decimal floating-point
value.
Converts the initial portion of
float wcstof(const wchar_t *nptr, the wide-character string
wcstof wchar.h
wchar_t **endptr); pointed to by nptr to a float
value.
Breaks wcs1 into a sequence of
tokens, each of which is
wchar_t *wcstok(wchar_t *wcs1,
wcstok wchar.h delimited by a wide character
const wchar_t *wcs2, wchar_t **ptr)
from the wide string pointed to
by wcs2.
Converts the initial portion of
long int wcstol(const wchar_t *nptr, the wide-character string
wcstol wchar.h
wchar_t **endptr, int base); pointed to by nptr to a long
integer value.
Converts the initial portion of
long double wcstold(const the wide-character string
wcstold wchar.h
wchar_t *nptr, wchar_t **endptr); pointed to by nptr to a long
double value.
size_t wcstombs(char *dest, const Converts the wchar_t string into
wcstombs stdlib.h
wchar_t *string, size_t count); a multibyte string dest.
Converts the initial portion of
unsigned long int wcstoul(const
the wide-character string
wcstoul wchar.h wchar_t *nptr, wchar_t **endptr,
pointed to by nptr to an
int base);
unsigned long integer value.
Transforms a wide-character
string to values which represent
size_t wcsxfrm (wchar_t *wcs1,
wcsxfrm4 wchar.h character collating weights and
const wchar_t *wcs2, size_t n);
places the resulting wide-
character string into an array.
Determines
whether wc corresponds to a
member of the extended
stdarg.h
wctob int wctob(wint_t wc); character set whose multibyte
wchar.h
character representation is a
single byte when in the initial
shift state.
System
Function Include Function Prototype Description
File
Converts the wchar_t value
int wctomb(char *string,
wctomb stdlib.h of character into a
wchar_t character);
multibyte string.
Constructs a value with type
wctrans_t that describes a
wctrans_t wctrans(const
wctrans wctype.h mapping between wide
char *property);
characters identified by the
string argument property.
wctype_t wctype (const Obtains handle for character
wctype4 wchar.h
char *property); property classification.
int wcswidth(const wchar_t *pwcs, Determine the display width of
wcwidth wchar.h
size_t n); a wide character string.
Locates the first occurrence
wchar_t *wmemchr(const of c in the initial n wide
wmemchr wchar.h
wchar_t *s, wchar_t c, size_t n); characters of the object pointed
to by s.
Compares the first n wide
int wmemcmp(const wchar_t *s1, characters of the object pointed
wmemcmp wchar.h
const wchar_t *s2, size_t n); to by s1 to the first n characters
of the object pointed to by s2.
Copies n wide characters from
wchar_t *wmemcpy(wchar_t *s1,
wmemcpy wchar.h the object pointed to by s2 to
const wchar_t *s2, size_t n);
the object pointed to by s1.
Copies n wide characters from
wchar_t *wmemmove(wchar_t *s1,
wmemmove wchar.h the object pointed to by s2 to
const wchar_t *s2, size_t n);
the object pointed to by s1.
Copies the value of c into each
wchar_t *wmemset(wchar_t *s,
wmemset wchar.h of the first n wide characters of
wchar_t c, size_t n);
the object pointed to by s.
Equivalent to fwprintf with the
int wprintf(const
wprintf6 wchar.h argument stdout interposed
wchar_t *format, arg-list);
before the arguments to wprintf.
Equivalent to fwscanf with the
int wscanf(const argument stdin interposed
wscanf6 wchar.h
wchar_t *format, arg-list); before the arguments of
wscanf.
Calculates the Bessel function
y0 math.h double y0(double x); value of the second kind of
order 0.
y1 math.h double y1(double x); Calculates the Bessel function
value of the second kind of
System
Function Include Function Prototype Description
File
order 1.
Calculates the Bessel function
yn math.h double yn(int n, double x); value of the second kind of
order n.

You might also like