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

strtol — convert text to long

strtol reads a long integer from the beginning of text. Check endptr and errno to detect errors and any unconsumed suffix.

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

strtold — convert text to long double

strtold from <stdlib.h> reads an initial number from text as long double. endptr lets you check where conversion stopped.

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

strtoll — convert text to long long

strtoll reads an initial signed integer as long long. endptr and errno let you check the conversion result.

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

strtoul — convert text to unsigned long

A guide to converting text to unsigned long and checking the result. The example demonstrates range checking and rejection of an unconsumed suffix.

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

strtoull — text to unsigned long long

strtoull converts an initial string portion to unsigned long long; endptr detects missing conversion and remaining text.

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

system — pass a command to the command processor

The system function from <stdlib.h> passes text to the environment's command processor. A NULL argument only queries its availability.

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

tan — tangent of an angle

The tan function from <math.h> computes the tangent of an angle in radians. It accepts double and returns double; its argument is not interpreted as degrees.

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

tanh — hyperbolic tangent

The tanh function from <math.h> computes the hyperbolic tangent of a double argument and returns a double result.

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

thrd_create — creating a thread

thrd_create starts func(arg) in a new thread and stores its identifier through thr. The call returns creation status, not the worker's result.

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

thrd_current — current thread identifier

The thrd_current function from <threads.h> returns the calling thread's identifier as a value of type thrd_t.

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

thrd_detach — detaching a thread

thrd_detach from <threads.h> arranges thread-resource reclamation after termination. It neither waits for termination nor stops the thread.

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

thrd_equal — comparing thread identity

The thrd_equal function from <threads.h> checks whether two thrd_t identifiers refer to the same thread. It returns zero or a nonzero value.

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

thrd_exit — terminate the calling thread

thrd_exit terminates the calling thread and sets its int result, which can be retrieved using thrd_join.

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

thrd_join — wait for thread termination

thrd_join blocks the calling thread until the specified thread terminates and optionally retrieves its int result. The operation status is separate from the thread result.

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

thrd_sleep — suspend the calling thread

thrd_sleep suspends the calling thread for a requested interval. A signal can interrupt the wait, and scheduling can extend it.

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

thrd_yield — allowing other threads to run

The thrd_yield function from <threads.h> attempts to allow other threads to run. It does not guarantee a context switch, takes no arguments, and returns no value.

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

time — obtaining the current calendar time

The time function from <time.h> returns an approximation of current calendar time as time_t; check for (time_t)(-1).

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

timespec_get — retrieving time

timespec_get stores time in struct timespec. Check its return value before reading the fields; nanosecond representation does not guarantee nanosecond resolution.

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

timespec_getres — time-base resolution

The C23 function timespec_getres queries the resolution of time supplied by timespec_get, rather than the current time.

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

tmpfile — creating a temporary file

tmpfile() creates a temporary binary file for reading and writing. It returns FILE * or NULL if file creation fails.

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

tmpnam — generate a name without creating a file

tmpnam generates a filename but neither reserves it nor creates a file. Learn about the L_tmpnam buffer, NULL results, and the race when opening the name later.

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

tolower — convert to lowercase

tolower from <ctype.h> maps an uppercase letter to lowercase using the locale. Its argument must fit unsigned char or equal EOF.

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

trunc — truncation toward zero

The trunc function from <math.h> removes the fractional part of a double by rounding toward zero. Its result is still a double, not an integer type.

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