call_once

Defined in header <threads.h> void call_once( once_flag* flag, void (*func)(void) ); (1) (since C11) typedef once_flag /* unspecified */ (2) (since C11) #define ONCE_FLAG_INIT /* unspecified */ (3) (since C11) 1) Calls function func exactly once, even if invoked from several threads. The completion of the function func synchronizes with all previous or subsequent calls to call_once with the same flag variable. 2) Complete object type capable of holding a flag

calloc

Defined in header <stdlib.h> void* calloc( size_t num, size_t size ); Allocates memory for an array of num objects of size size and initializes all bits in the allocated storage to zero. If allocation succeeds, returns a pointer to the lowest (first) byte in the allocated memory block that is suitably aligned for any object type. If size is zero, the behavior is implementation defined (null pointer may be returned, or some non-null pointer may be returned that may not be us

cacoshf

Defined in header <complex.h> float complex cacoshf( float complex z ); (1) (since C99) double complex cacosh( double complex z ); (2) (since C99) long double complex cacoshl( long double complex z ); (3) (since C99) Defined in header <tgmath.h> #define acosh( z ) (4) (since C99) 1-3) Computes complex arc hyperbolic sine of a complex value z with branch cut at values less than 1 along the real axis. 4) Type-generic macro: If z has

cacosf

Defined in header <complex.h> float complex cacosf( float complex z ); (1) (since C99) double complex cacos( double complex z ); (2) (since C99) long double complex cacosl( long double complex z ); (3) (since C99) Defined in header <tgmath.h> #define acos( z ) (4) (since C99) 1-3) Computes the complex arc cosine of z with branch cuts outside the interval [−1,+1] along the real axis. 4) Type-generic macro: If z has type long double

cabsf

Defined in header <complex.h> float cabsf( float complex z ); (1) (since C99) double cabs( double complex z ); (2) (since C99) long double cabsl( long double complex z ); (3) (since C99) Defined in header <tgmath.h> #define fabs( z ) (4) (since C99) 1-3) Computes the complex absolute value (also known as norm, modulus, or magnitude) of z. 4) Type-generic macro: if z has type long double complex or long double imaginary, cabsl is c

c32rtomb

Defined in header <uchar.h> size_t c32rtomb( char* s, char32_t c32, mbstate_t* ps ); (since C11) Converts a 32-bit wide character to its narrow multibyte representation. If s is not a null pointer, the function determines the number of bytes necessary to store the multibyte character representation of c32 (including any shift sequences), and stores the multibyte character representation in the character array whose first element is pointed to by s. At most MB_CUR_MAX bytes

c16rtomb

Defined in header <uchar.h> size_t c16rtomb( char* s, char16_t c16, mbstate_t* ps ); (since C11) Converts a 16-bit wide character to narrow multibyte character. If s is not a null pointer, the function determines the number of bytes necessary to store the multibyte character representation of c16 (including any shift sequences), and stores the multibyte character representation in the character array whose first element is pointed to by s. At most MB_CUR_MAX bytes can be wr

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

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 language

This is a reference of the core C language constructs. Basic concepts. Comments ASCII chart Translation phases identifier - scope - lifetime lookup and name spaces type - arithmetic types objects and alignment The main function Memory model and data races. Keywords. Preprocessor. #if - #ifdef - #ifndef #define - # - ## #include - #pragma #line - #error. Statements. if - switch for while - do-while continue - break goto - return. Expressions. Value categories Evaluation or