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

modf

Defined in header <math.h> float modff( float arg, float* iptr ); (1) (since C99) double modf( double arg, double* iptr ); (2) long double modfl( long double arg, long double* iptr ); (3) (since C99) 1-3) Decomposes given floating point value arg into integral and fractional parts, each having the same type and sign as arg. The integral part (in floating-point format) is stored in the object pointed to by iptr. Parameters arg - floating point

Objects and alignment

C programs create, destroy, access, and manipulate objects. An object, in C, is region of data storage in the execution environment, the contents of which can represent values (a value is the meaning of the contents of an object, when interpreted as having a specific type). Every object has. size (can be determined with sizeof) alignment requirement (can be determined by alignof) (since C11) storage duration (automatic, static, allocated, thread-local) lifetime (equal to storage duration

_Alignof

Usage _Alignof operator

wcsftime

Defined in header <wchar.h> size_t wcsftime( wchar_t* str, size_t count, const wchar_t* format, tm* time ); (since C95) Converts the date and time information from a given calendar time time to a null-terminated wide character string str according to format string format. Up to count bytes are written. Parameters str - pointer to the first element of the wchar_t array for output count - maximum number of wide characters to write format - pointer to a nul

sizeof operator

Queries size of the object or type. Used when actual size of the object must be known. Syntax sizeof( type ) (1) sizeof expression (2) Both versions return a value of type size_t. Explanation 1) Returns the size, in bytes, of the object representation of type 2) Returns the size, in bytes, of the object representation of the type of expression Notes Depending on the computer architecture, a byte may consist of 8 or more bits, the exact number provided as CHAR_BIT. si

return statement

Terminates current function and returns specified value to the caller function. Syntax return expression ; (1) return ; (2) Explanation 1) Evaluates the expression, terminates the current function and returns the result of the expression to the caller (the value returned becomes the value of the function call expression). Only valid if the function return type is not void. 2) Terminates the current function. Only valid if the function return type is void. If the type of th

union

Usage declaration of a union type

ATOMIC_*_LOCK_FREE

Defined in header <stdatomic.h> #define ATOMIC_BOOL_LOCK_FREE /* implementation-defined */ #define ATOMIC_CHAR_LOCK_FREE /* implementation-defined */ #define ATOMIC_CHAR16_T_LOCK_FREE /* implementation-defined */ #define ATOMIC_CHAR32_T_LOCK_FREE /* implementation-defined */ #define ATOMIC_WCHAR_T_LOCK_FREE /* implementation-defined */ #define ATOMIC_SHORT_LOCK_FREE /* implementation-defined */ #define ATOMIC_INT_LOCK_FREE /* implementation-defined */ #define ATOM

cbrt

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