do-while loop

Executes a statement repeatedly until the value of condition becomes false. The test takes place after each iteration. Syntax do statement while ( expression ) ; expression - any expression of scalar type. This expression is evaluated after each iteration, and if it compares equal to zero, the loop is exited. statement - any statement, typically a compound statement, which is the body of the loop Explanation A do-while statement causes the statement (also called the

do

Usage do-while loop: as the declaration of the loop

div

Defined in header <stdlib.h> div_t div( int x, int y ); (1) ldiv_t ldiv( long x, long y ); (2) lldiv_t lldiv( long long x, long long y ); (3) (since C99) Defined in header <inttypes.h> imaxdiv_t imaxdiv( intmax_t x, intmax_t y ); (4) (since C99) Computes both the quotient and the remainder of the division of the numerator x by the denominator y. Computes quotient and remainder simultaneously. The quotient is the algebraic quotient wi

difftime

Defined in header <time.h> double difftime( time_t time_end, time_t time_beg ); Computes difference between two calendar times as time_t objects (time_end - time_beg) in seconds. If time_end refers to time point before time_beg then the result is negative. Parameters time_beg, time_end - times to compare Return value Difference between two times in seconds. Notes On POSIX systems, time_t is measured in seconds, and difftime is equivalent to arithmetic subtr

default

Usage switch statement: as the declaration of the default case label type-generic expression: as the declaration of the default generic association (since C11)

Declarations

A declaration is a C language construct that introduces one or more identifiers into the program and specifies their meaning and properties. Declarations may appear in any scope. Each declaration ends with a semicolon (just like a statement) and consists of two distinct parts: specifiers-and-qualifiers declarators-and-initializers ; where. specifiers-and-qualifiers - whitespace-separated list of, in any order, exactly one type specifier: void the name of an arithmetic type th

Date and time utilities

Functions Time manipulation Defined in header <time.h> difftime computes the difference between times (function) time returns the current calendar time of the system as time since epoch (function) clock returns raw processor clock time since the program is started (function) timespec_get (since C11) returns the calendar time based on a given time base (function) Format conversions Defined in header <time.h> asctimeasctime_s (C11) conv

ctime

Defined in header <time.h> char* ctime( const time_t* time ); (1) errno_t ctime_s(char *buffer, rsize_t bufsz, const time_t *time); (2) (since C11) 1) Converts given time since epoch to a calendar local time and then to a textual representation, as if by calling asctime(localtime(time)). 2) Same as (1), except that the function is equivalent to asctime_s(buffer, bufsz, localtime_s(time, &(struct tm){0})), and the following errors are detected at runtime and call

ctanhf

Defined in header <complex.h> float complex ctanhf( float complex z ); (1) (since C99) double complex ctanh( double complex z ); (2) (since C99) long double complex ctanhl( long double complex z ); (3) (since C99) Defined in header <tgmath.h> #define tanh( z ) (4) (since C99) 1-3) Computes the complex hyperbolic tangent of z. 4) Type-generic macro: If z has type long double complex, ctanhl is called. if z has type double complex,

ctanf

Defined in header <complex.h> float complex ctanf( float complex z ); (1) (since C99) double complex ctan( double complex z ); (2) (since C99) long double complex ctanl( long double complex z ); (3) (since C99) Defined in header <tgmath.h> #define tan( z ) (4) (since C99) 1-3) Computes the complex tangent of z. 4) Type-generic macro: If z has type long double complex, ctanl is called. if z has type double complex, ctan is called,