Comparison operators

Comparison operators are binary operators that test a condition and return 1 if that condition is logically true and 0 if that condition is false.. Operator Operator name Example Description == equal to a == b a is equal to b != not equal to a != b a is not equal to b < less than a < b a is less than b > greater than a > b a is greater than b <= less than or equal to a <= b a is less than or equal to b >= greater than or eq

Common mathematical functions

Functions Defined in header <stdlib.h> abslabsllabs (C99) computes absolute value of an integral value (|x|) (function) divldivlldiv (C99) computes quotient and remainder of integer division (function) Defined in header <inttypes.h> imaxabs (C99) computes absolute value of an integral value (|x|) (function) imaxdiv (C99) computes quotient and remainder of integer division (function) Defined in header <math.h> Basic operations fa

Comments

Comments serve as a sort of in-code documentation. When inserted into a program, they are effectively ignored by the compiler; they are solely intended to be used as notes by the humans that read source code. Syntax /* comment */ (1) // comment\n (2) (since C99) 1) Often known as "C-style" or "multi-line" comments. 2) Often known as "C++-style" or "single-line" comments. All comments are removed from the program at translation phase 3 by replacing each comment with a single w

cnd_wait

Defined in header <threads.h> int cnd_wait( cnd_t* cond, mtx_t* mutex ); (since C11) Atomically unlocks the mutex pointed to by mutex and blocks on the condition variable pointed to by cond until the thread is signalled by cnd_signal or cnd_broadcast. The mutex is locked again before the function returns. The behavior is undefined if the mutex is not already locked by the calling thread. Parameters cond - pointer to the condition variable to block on mutex - p

cnd_timedwait

Defined in header <threads.h> int cnd_timedwait( cnd_t* restrict cond, mtx_t* restrict mutex, const struct timespec* restrict time_point ); (since C11) Atomically unlocks the mutex pointed to by mutex and blocks on the condition variable pointed to by cond until the thread is signalled by cnd_signal or cnd_broadcast, or until the TIME_UTC based time point pointed to by time_point has been reached. The mutex is locked again before the function returns. The

cnd_signal

Defined in header <threads.h> int cnd_signal( cnd_t *cond ); (since C11) Unblocks one thread that currently waits on condition variable pointed to by cond. If no threads are blocked, does nothing and returns thrd_success. Parameters cond - pointer to a condition variable Return value thrd_success if successful, thrd_error otherwise. References C11 standard (ISO/IEC 9899:2011): 7.26.3.4 The cnd_signal function (p: 379) See also cnd_broadcast (C11)

cnd_init

Defined in header <threads.h> int cnd_init( cnd_t* cond ); (since C11) Initializes new condition variable. The object pointed to by cond will be set to value that identifies the condition variable. Parameters cond - pointer to a variable to store identifier of the condition variable to Return value thrd_success if the condition variable was successfully created. Otherwise returns thrd_nomem if there was insufficient amount of memory or thrd_error if another er

cnd_destroy

Defined in header <threads.h> void cnd_destroy( cnd_t* cond ); (since C11) Destroys the condition variable pointed to by cond. If there are threads waiting on cond, the behavior is undefined. Parameters cond - pointer to the condition variable to destroy Return value (none). References C11 standard (ISO/IEC 9899:2011): 7.26.3.2 The cnd_destroy function (p: 378-379)

cnd_broadcast

Defined in header <threads.h> int cnd_broadcast( cnd_t *cond ); (since C11) Unblocks all thread that currently wait on condition variable pointed to by cond. If no threads are blocked, does nothing and returns thrd_success. Parameters cond - pointer to a condition variable Return value thrd_success if successful, thrd_error otherwise. References C11 standard (ISO/IEC 9899:2011): 7.26.3.1 The cnd_broadcast function (p: 378) See also cnd_signal (C1

CMPLXF

Defined in header <complex.h> float complex CMPLXF( float real, float imag ); (since C11) double complex CMPLX( double real, double imag ); (since C11) long double complex CMPLXL( long double real, long double imag ); (since C11) Each of these macros expands to an expression that evaluates to the value of the specified complex type, with the real part having the value of real (converted to the specified argument type) and the imaginary part having the