C memory management library

Functions Defined in header <stdlib.h> malloc allocates memory (function) calloc allocates and zeroes memory (function) realloc expands previously allocated memory block (function) free deallocates previously allocated memory (function) aligned_alloc (C11) allocates aligned memory (function) References C11 standard (ISO/IEC 9899:2011): 7.22.3 Memory management functions (p: 347-349) C99 standard (ISO/IEC 9899:1999): 7.20.3 Memory management funct

C Operator Precedence

The following table lists the precedence and associativity of C operators. Operators are listed top to bottom, in descending precedence. Precedence Operator Description Associativity 1 ++ -- Suffix/postfix increment and decrement Left-to-right () Function call [] Array subscripting . Structure and union member access -> Structure and union member access through pointer (type){list} Compound literal(C99) 2 ++ -- Prefix increment and decrement Right-t

log2

Defined in header <math.h> float log2f( float arg ); (1) (since C99) double log2( double arg ); (2) (since C99) long double log2l( long double arg ); (3) (since C99) Defined in header <tgmath.h> #define log2( arg ) (4) (since C99) 1-3) Computes the base 2 logarithm of arg. 4) Type-generic macro: If arg has type long double, log2l is called. Otherwise, if arg has integer type or the type double, log2 is called. Otherwise, log2f is

fgetpos

Defined in header <stdio.h> int fgetpos( FILE *stream, fpos_t *pos ); (until C99) int fgetpos( FILE *restrict stream, fpos_t *restrict pos ); (since C99) Obtains the file position indicator and the current parse state (if any) for the file stream stream and stores them in the object pointed to by pos. The value stored is only meaningful as the input to fsetpos. Parameters stream - file stream to examine pos - pointer to a fpos_t object

_Complex

Usage _Complex type: as the declaration of the type

MATH_ERRNO

Defined in header <math.h> #define MATH_ERRNO 1 (since C99) #define MATH_ERREXCEPT 2 (since C99) #define math_errhandling /*implementation defined*/ (since C99) The macro constant math_errhandling expands to an expression of type int that is either equal to MATH_ERRNO, or equal to MATH_ERREXCEPT, or equal to their bitwise OR (MATH_ERRNO | MATH_ERREXCEPT). The value of math_errhandling indicates the type of error handling that is performed by the float

tmpfile

Defined in header <stdio.h> FILE *tmpfile(); (1) errno_t tmpfile_s(FILE * restrict * restrict streamptr); (2) (since C11) 1) Creates and opens a temporary file. The file is opened as binary file for update (as if by fopen with "wb+ mode). The filename of the file is guaranteed to be unique within the filesystem. At least TMP_MAX files may be opened during the lifetime of a program (this limit may be shared with tmpnam and may be further limited by FOPEN_MAX). 2) Sam

hypot

Defined in header <math.h> float hypotf( float x, float y ); (1) (since C99) double hypot( double x, double y ); (2) (since C99) long double hypotl( long double x, long double y ); (3) (since C99) Defined in header <tgmath.h> #define hypot( x, y ) (4) (since C99) 1-3) Computes the square root of the sum of the squares of x and y, without undue overflow or underflow at intermediate stages of the computation. 4) Type-generic macro:

Conversions

Several operators convert operand values from one type to another automatically. This subclause specifies the result required from such an implicit conversion, as well as those that result from a cast operation (an explicit conversion). Conversion of an operand value to a compatible type causes no change to the value or the representation. Notes Conversions performed by most ordinary operators appear here. Additional details, if any, about conversions performed by an operator appear in the d

FE_DIVBYZERO

Defined in header <<fenv.h>> #define FE_DIVBYZERO /*implementation defined power of 2*/ (since C99) #define FE_INEXACT /*implementation defined power of 2*/ (since C99) #define FE_INVALID /*implementation defined power of 2*/ (since C99) #define FE_OVERFLOW /*implementation defined power of 2*/ (since C99) #define FE_UNDERFLOW /*implementation defined power of 2*/ (since C99) #define FE_ALL_EXCEPT FE_DIVBYZERO | FE_INEXACT |