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

Functions List

This document lists C standard library functions organized by header file, including their syntax, purpose, and a brief description. It includes common mathematical functions like abs, log, and sqrt, string functions like strcat and strcmp, I/O functions like fopen and fprintf, memory allocation functions like malloc and free, and character testing and conversion functions like isdigit and tolower.

Uploaded by

VaidehiBaporikar
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as DOCX, PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
44 views

Functions List

This document lists C standard library functions organized by header file, including their syntax, purpose, and a brief description. It includes common mathematical functions like abs, log, and sqrt, string functions like strcat and strcmp, I/O functions like fopen and fprintf, memory allocation functions like malloc and free, and character testing and conversion functions like isdigit and tolower.

Uploaded by

VaidehiBaporikar
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as DOCX, PDF, TXT or read online on Scribd
You are on page 1/ 2

Function Header File Syntax Purpose

abs stdlib.h int abs(int n); Calculates the absolute value of an


integer argument n.
log math.h double log(double x); Calculates the natural logarithm of x.
log10 math.h double log10(double x); Calculates the base 10 logarithm of x.
pow math.h double pow(double x, double y); Calculates the value x to the power y.
sqrt math.h double sqrt(double x); Calculates the square root of x.
cos math.h double cos(double x); Calculates the cosine of x.
atof stdlib.h double atof(const char *string); Converts string to a double-precision
floating-point value.
atoi stdlib.h int atoi(const char *string); Converts string to an integer.
atol stdlib.h long int atol(const char *string); Converts string to a long integer.
isalnum ctype.h int isalnum(int c); Tests if c is alphanumeric.
isdigit ctype.h int isdigit(int c); Tests if c is a decimal digit.
islower ctype.h int islower(int c); Tests if c is a lowercase letter.
isspace ctype.h int isspace(int c); Tests if c is a whitespace character.
isupper ctype.h int isupper(int c); Tests if c is an uppercase letter.
tolower ctype.h int tolower(int c); Converts c to lowercase.
toupper ctype.h int toupper(int c); Converts c to uppercase.
strcat string.h char *strcat(char *string1, const Concatenates string2 to string1.
char *string2);
strchr string.h char *strchr(const char *string, Locates the first occurrence of c in string.
int c);
strcmp string.h int strcmp(const char *string1, Compares the value of string1 to string2.
const char *string2);
strcpy string.h char *strcpy(char *string1, const Copies string2 into string1.
char *string2);
strlen string.h size_t strlen(const char *string); Calculates the length of string.
fclose stdio.h int fclose(FILE *stream); Closes the specified stream.
feof stdio.h int feof(FILE *stream); Tests whether the end-of-file flag is set
for a given stream.
fgetc stdio.h int fgetc(FILE *stream); Reads a single unsigned character from
the input stream.
fgets1 stdio.h char *fgets(char *string, int n, Reads a string from the input stream.
FILE *stream);
fopen stdio.h FILE *fopen(const char Opens the specified file.
*filename, const char *mode);
fprintf stdio.h int fprintf(FILE *stream, const Formats and prints characters and values
char *format-string, arg-list); to the output stream.
fputc1 stdio.h int fputc(int c, FILE *stream); Prints a character to the output stream.
fputs stdio.h int fputs(const char *string, Copies a string to the output stream.
FILE *stream);
fscanf stdio.h int fscanf(FILE *stream, const Reads data from stream into locations
char *format-string, arg-list); given by arg-list.
fseek stdio.h int fseek(FILE *stream, long Changes the current file position
int offset, int origin); associated with stream to a new location.
ftell stdio.h long int ftell(FILE *stream); Gets the current position of the file
pointer.
gets stdio.h char *gets(char *buffer); Reads a string from stdin, and stores it
in buffer.
getc stdio.h int getc(FILE *stream); Reads a single character from the
input stream.
putc stdio.h int putc(int c, FILE *stream); Prints c to the output stream.
calloc stdlib.h void *calloc(size_t num, Reserves storage space for an array
size_t size); of numelements, each of size size, and
initializes the values of all elements to 0.
free stdlib.h void free(void *ptr); Frees a block of storage.
malloc stdlib.h void *malloc(size_t size); Reserves a block of storage.
realloc stdlib.h void *realloc(void *ptr, Changes the size of a previously reserved
size_t size); storage block.

You might also like