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

Decrement operator --

The `--` operator performs a decrement. In C23, decrementing a `bool` that holds `false` stores `true`. The prefix form yields the new value; the postfix form yields the previous value.

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

Division operator /

The / operator divides two operands. Integer division discards the fractional part; conversion before division enables a floating-point result.

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

Division assignment (/=)

The /= operator divides the left operand's existing value by the right operand and stores the result back.

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

Equality operator ==

The == operator tests operands for equality. Its result has type int: 1 means equal, and 0 means unequal.

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

Function-call operator ()

The () operator calls a function, passing argument values to parameters. It also works with a function pointer; it does not establish argument evaluation order.

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

Operator >= — greater than or equal to

The >= operator tests whether the left operand is greater than or equal to the right. It returns int: 1 or 0.

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

Greater-than operator >

The > operator tests strict ordering. It returns int: 1 for true or 0 for false, including equality.

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

Increment operator ++

Prefix `++` yields the operand’s updated value; postfix `++` yields its previous value. These values can be equal: in C23, if a `bool` operand is already `true`, both forms yield `true` and leave the operand unchanged.

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

Inequality operator !=

The != operator tests whether operands are unequal. It returns an int value: 1 for inequality and 0 for equality.

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

Left-shift operator <<

The << operator shifts bits left. Learn integer promotions, shift-count limits, and the differences between signed and unsigned operands.

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

Left-shift assignment (<<=)

The <<= operator shifts an integer value left and stores the result in its left operand.

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

Less-than-or-equal operator (<=)

The <= operator tests whether the left operand is less than or equal to the right operand. Its result is an int: either 1 or 0.

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

Less-than operator (<)

The < operator tests strict ordering. Its int result is 1 when the comparison is true and 0 otherwise.

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

Logical AND operator (&&)

The && operator tests whether both operands are nonzero. It returns int 0 or 1 and skips the right operand when the left is zero.

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

Logical negation operator !

The ! operator reverses truth: it produces 1 for zero and 0 for a nonzero value. Its result has type int.

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

Logical OR operator (||)

The || operator returns int with value 1 when at least one operand is nonzero; otherwise it returns 0. The right operand may be skipped.

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

Member access: the . operator

The . operator selects a named member of a struct or union object. For a pointer, use -> instead.

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

Multiplication assignment operator (*=)

The *= operator multiplies the left operand's current value by the right operand and stores the result back. The left operand is evaluated only once.

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

Operator ->: member access through a pointer

The -> operator selects a structure or union member through a pointer. The expression p->x corresponds to (*p).x and supports reading or, when the member is modifiable, writing. It does not validate the pointer.

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

Remainder operator (%)

The % operator computes the remainder of integer division. Results can be negative; a zero divisor causes undefined behavior.

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

Remainder assignment (%=)

The %= operator stores an integer division remainder in its left operand, evaluating that operand only once.

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

Bitwise right-shift operator (>>)

The >> operator shifts bits right. Its result depends on the left operand's type and sign; the shift count must stay within the permitted range.

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

Right-shift assignment (>>=)

The >>= operator shifts an integer value right and stores the result in the left operand.

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

sizeof — size in bytes

The sizeof operator returns the size of a type or expression in bytes as size_t. Distinguish array size from pointer size, and remember the variable-length-array exception.

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