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

while — pre-test loop

A while loop checks its condition before each iteration. It repeats while the condition is nonzero and may never execute its body.

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

Integer constant macros

Macros from <stdint.h> produce portable integer constant expressions without manually selecting suffixes. Their numbered variants correspond to minimum-width types, not necessarily exact-width types.

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

C language-version and feature-availability macros

Distinguish the language version, execution environment, missing optional features, and header revisions. These macros select code during compilation; they do not attest that the production runtime works.

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

NULL — null pointer constant macro

NULL from <stddef.h> denotes a null pointer constant. Use it to initialize pointers and compare them with a null value.

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

offsetof — a subobject's byte offset

The offsetof macro from <stddef.h> gives a subobject's offset from the start of an object as a constant expression of type size_t.

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

unreachable — marking an unreachable path

The C23 unreachable macro marks a path execution must never reach. Reaching the invocation causes undefined behavior.

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

main: the program entry point

The main function is the starting point of a C program in a hosted environment. Its result reports program termination to that environment.

Basic · C23
C

*: multiplying numeric values

The binary * operator multiplies arithmetic values. The result and overflow rules depend on the operand types after the usual conversions.

Basic · C23
C

Addition operator (+)

Binary + adds numbers or moves a pointer by an integer number of array elements, rather than bytes.

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

Addition assignment operator (+=)

The += operator adds the right operand to the left and stores the result on the left, evaluating the destination only once.

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

Address-of operator (&)

The unary & operator produces a pointer to an object or function. It enables operations such as modifying an object indirectly through a pointer.

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

Array subscript operator []

The [] operator designates an element using an array or pointer and an integer index. Indexing starts at zero; the programmer must keep accesses within bounds.

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

Simple assignment operator (=)

The = operator stores a value in the object on its left. Do not confuse assignment with equality comparison == or initialization.

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

Bitwise AND operator (&)

The binary & operator keeps only bits set in both integer operands. One common use is masking bits.

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

Bitwise AND assignment (&=)

The &= operator stores a bitwise AND result in its left operand, retaining only bits set in both operands.

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

Bitwise NOT operator (~)

The ~ operator inverts an integer value's bits after integer promotions. Use it to invert masks and clear selected bits.

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

Bitwise OR operator |

The | operator combines the bits of two integers. It can set flags without clearing other bits.

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

Bitwise OR assignment operator (|=)

The |= operator stores the operands’ bitwise OR in the left operand. Use it to set mask bits.

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

Bitwise XOR operator (^)

The ^ operator compares corresponding bits of two integers. A result bit is 1 when the operand bits differ.

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

Bitwise XOR assignment (^=)

The ^= operator computes bitwise XOR, converts the result to the type of the left operand, and stores it there.

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

Cast operator (type)

A cast explicitly converts an expression's value. Its placement determines whether conversion happens before or after a calculation.

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

Comma operator

The `,` operator evaluates the left expression before the right, discards the left value, and yields the right result.

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

Conditional operator ?:

The ?: operator selects one of two expressions using a condition and supplies its value after required conversions.

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