Knowledge baseExam Center
ENEnglish
Choose language13

CKTIS / C

Knowledge base — C

Programming syntax, operators and concepts. Find an explanation, explore an example and return to learning.

Entries: 472

C

Variable-length array (VLA) in C

A local buffer declared as `int tmp[n]` gets its length at run time. Validate the bound before declaring it, respect its lifetime, and account for optional automatic VLA support in C23.

Advanced · ISO C23; implementation support may vary
C

Function pointer declarator

Declare function pointers, read the grouping parentheses, and recognize functions that return these pointers.

Intermediate · C23; repository compiler flag, production runtime not attested
C

abort — abnormal program termination

The abort() function from <stdlib.h> initiates abnormal program termination and never returns to its caller.

Basic · C23; repository compiler flag, production runtime not attested
C

abs — absolute value of an int

The abs function from <stdlib.h> returns an int absolute value. Calling abs(INT_MIN) has undefined behavior.

Basic · C23; repository compiler flag, production runtime not attested
C

acos — inverse cosine

The acos function from <math.h> computes the principal inverse cosine of a double argument. Its result is an angle in radians, not degrees.

Basic · C23; repository compiler flag, production runtime not attested
C

acosh — inverse hyperbolic cosine

The acosh function from <math.h> computes the nonnegative inverse hyperbolic cosine. It takes and returns double; an argument below 1 causes a domain error.

Basic · C23; repository compiler flag, production runtime not attested
C

asctime — fixed-format date and time text

asctime converts struct tm into fixed-format text. In C23, the function is deprecated and should be avoided in new code.

Intermediate · C23; repository compiler flag, production runtime not attested
C

asin — arcsine

The asin function from <math.h> computes the principal arcsine of a double argument and returns an angle in radians.

Basic · C23; repository compiler flag, production runtime not attested
C

asinh — inverse hyperbolic sine

asinh from <math.h> computes the inverse hyperbolic sine of a double argument and returns double. Its mathematical domain is all real numbers.

Basic · C23; repository compiler flag, production runtime not attested
C

assert — C23 macro

The `assert(...)` macro from `<assert.h>` checks a scalar expression: true does nothing, while false prints diagnostic information and calls `abort()`. It returns no value.

Basic · C23
C

atan — C23 library function

`atan(double x)` from `<math.h>` returns the principal arctangent of its argument in radians in the interval `-π/2` through `π/2`; every real number is in its domain.

Intermediate · C23
C

atan2 — C23 library function

`atan2(double y, double x)` from `<math.h>` returns the directional angle of point `(x, y)` from the positive x-axis, in radians in the interval `-π` through `π`. Its arguments are ordered `y` first, then `x`.

Intermediate · C23
C

atanh — C23 library function

`atanh(double x)` from `<math.h>` returns the real principal inverse hyperbolic tangent. For a finite real result, the argument must be in the open interval `(-1, 1)`.

Intermediate · C23
C

atexit — C23 library function

`atexit(void (*func)(void))` from `<stdlib.h>` registers a no-argument function to be called during normal program termination. It returns zero on success and a nonzero value when registration fails.

Intermediate · C23
C

atof — C23 library function

`atof(const char *nptr)` from `<stdlib.h>` converts the initial portion of a string to `double`; it behaves like `strtod(nptr, NULL)` but provides neither a useful end pointer nor dependable error diagnostics.

Basic · C23
C

atoi — C23 library function

`atoi(const char *nptr)` from `<stdlib.h>` converts an initial decimal integer in a string and returns `int`. It skips leading white space, accepts an optional sign, and stops at the first character that does not belong to the number.

Basic · C23
C

atol — C23 library function

`atol(const char *nptr)` from `<stdlib.h>` reads an initial decimal integer and returns `long int`. It skips white space, accepts an optional sign, and stops at the first character outside the number.

Basic · C23
C

atoll — C23 library function

`atoll(const char *nptr)` from `<stdlib.h>` converts an initial decimal integer and returns `long long int`. It skips white space, recognizes an optional sign, and ends at the first nonmatching character.

Basic · C23
C

atomic_compare_exchange_strong — C23 atomic generic function

`atomic_compare_exchange_strong(object, expected, desired)` from `<stdatomic.h>` atomically compares atomic `*object` with non-atomic `*expected`. If equal it stores `desired` in the object and returns `true`; otherwise it writes the object’s current value to `*expected` and returns `false`, without spurious failure.

Advanced · C23
C

atomic_compare_exchange_weak — C23 atomic generic function

`atomic_compare_exchange_weak(object, expected, desired)` has the same success store and failure update of `*expected` as the `strong` form, but it may return `false` spuriously even when the values compare equal. The read-modify-write on `object` remains atomic; the failure write to `expected` is an ordinary non-atomic write.

Advanced · C23
C

atomic_exchange — C23 atomic generic function

`atomic_exchange(object, desired)` from `<stdatomic.h>` performs one atomic read-modify-write operation: it stores `desired` in `*object` and returns the value the object held immediately before the exchange.

Advanced · C23
C

atomic_fetch_add — C23 atomic generic function

`atomic_fetch_add(object, operand)` from `<stdatomic.h>` atomically adds `operand` to an atomic integer or pointer object and returns the value from before the addition. It is one read-modify-write operation.

Advanced · C23