mbrtoc32

Defined in header <uchar.h> size_t mbrtoc32( char32_t* pc32, const char* s, size_t n, mbstate_t* ps ); (since C11) Converts a narrow multibyte character to its 32-bit character representation (typically, UTF-32). If s is not a null pointer, inspects at most n bytes of the multibyte character string, beginning with the byte pointed to by s to determine the number of bytes necessary to complete the next multibyte character (including any shift sequences). If the function dete

mbrlen

Defined in header <wchar.h> size_t mbrlen( const char* s, size_t n, mbstate_t* ps ); (since C95) Determines the size, in bytes, of the remainder of the multibyte character whose first byte is pointed to by s, given the current conversion state ps. This function is equivalent to the call mbrtowc(nullptr, s, n, ps?ps:&internal) for some hidden object internal of type mbstate_t, except that the expression ps is evaluated only once. Parameters s - pointer to an elem

mblen

Defined in header <stdlib.h> int mblen( const char* s, size_t n ); Determines the size, in bytes, of the multibyte character whose first byte is pointed to by s. If s is a null pointer, resets the global conversion state and determined whether shift sequences are used. This function is equivalent to the call mbtowc((wchar_t*)0, s, n), except that conversion state of mbtowc is unaffected. Notes Each call to mblen updates the internal global conversion state (a static obje

Lookup and name spaces

When an identifier is encountered in a C program, a lookup is performed to locate the declaration that introduced that identifier and that is currently in scope. C allows more than one declaration for the same identifier to be in scope simultaneously if these identifiers belong to different categories, called name spaces: 1) Label name space: all identifiers declared as labels. 2) Tag names: all identifiers declared as names of structs, unions and enumerated types. Note that all three kinds o

malloc

Defined in header <stdlib.h> void* malloc( size_t size ); Allocates size bytes of uninitialized storage. 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 used to access storage). malloc is thread-safe: it behaves as though only accessing

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

Main function

Every C program contains the definition (not the prototype) of a function called main, which is the designated start of the program. int main (void) { body } (1) int main (int argc, char *argv[]) { body } (2) int main (int argc, char *argv[] , other_parameters ) { body } (3) /* another implementation-defined signature */ (4) Parameters argc - Non-negative value representing the number of arguments passed to the program from the environment in which the progr

longjmp

Defined in header <setjmp.h> void longjmp( jmp_buf env, int status ); (until C11) _Noreturn void longjmp( jmp_buf env, int status ); (since C11) Loads the execution context env saved by a previous call to setjmp. This function does not return. Control is transferred to the call site of the macro setjmp that set up env. That setjmp then returns the value, passed as the status. If the function that called setjmp has exited (whether by return or by a different longjmp hi

Logical operators

Logical operators apply standard boolean algebra operations to their operands. Operator Operator name Example Result ! logical NOT !a the logical negation of a && logical AND a && b the logical AND of a and b || logical OR a || b the logical OR of a and b Logical NOT The logical NOT expression has the form. ! expression where. expression - an expression of any scalar type The logical NOT operator has type int. Its value is ​0​

long

Usage long type modifier