Static storage duration

An object whose identifier is declared without the storage-class specifier _Thread_local, and either with external or internal linkage or with the storage-class specifier static, has static storage duration. Its lifetime is the entire execution of the program and its stored value is initialized only once, prior to program startup. Notes Since its stored value is initialized only once, an object with static storage duration can profile the invocations of a function. The other use of the keywo

atomic_fetch_or

Defined in header <stdatomic.h> C atomic_fetch_or( volatile A* obj, M arg ); (1) (since C11) C atomic_fetch_or_explicit( volatile A* obj, M arg, memory_order order ); (2) (since C11) Atomically replaces the value pointed by obj with the result of bitwise OR between the old value of obj and arg, and returns the value obj held previously. The operation is read-modify-write operation. The first version orders memory accesses according to memory_order_seq_cst, the second

sig_atomic_t

Defined in header <signal.h> typedef /* unspecified */ sig_atomic_t; An integer type which can be accessed as an atomic entity even in the presence of asynchronous interrupts made by signals. Example #include <signal.h> #include <stdio.h> volatile sig_atomic_t gSignalStatus = 0; void signal_handler(int signal) { gSignalStatus = signal; } int main(void) { /* Install a signal handler. */ signal(SIGINT, signal_handler); printf("SignalVa

vscanf

Defined in header <stdio.h> ​int vscanf( const char *restrict format, va_list vlist );​ (1) (since C99) int vfscanf( FILE *restrict stream, const char *restrict format, va_list vlist ); (2) (since C99) int vsscanf( const char *restrict buffer, const char *restrict format, va_list vlist ); (3) (since C99) int vscanf_s(const char *restrict format, va_list vlist); (4) (since C11) int vfscanf_s( FILE *restrict stream, const char *res

alignas

Appears in the declaration syntax as one of the type specifiers to modify the alignment requirement of the object being declared. Syntax _Alignas ( expression ) (1) (since C11) _Alignas ( type ) (2) (since C11) expression - any integer constant expression whose value is a valid alignment or zero type - any type name This keyword is also available as convenience macro alignas, available in the header <stdalign.h>. Explanation The alignas specifier can only

atomic_fetch_xor

Defined in header <stdatomic.h> C atomic_fetch_xor( volatile A* obj, M arg ); (1) (since C11) C atomic_fetch_xor_explicit( volatile A* obj, M arg, memory_order order ); (2) (since C11) Atomically replaces the value pointed by obj with the result of bitwise XOR between the old value of obj and arg, and returns the value obj held previously. The operation is read-modify-write operation. The first version orders memory accesses according to memory_order_seq_cst, the seco

putchar

Defined in header <stdio.h> int putchar( int ch ); Writes a character ch to stdout. Internally, the character is converted to unsigned char just before being written. Equivalent to putc(ch, stdout). Parameters ch - character to be written Return value On success, returns the written character. On failure, returns EOF and sets the error indicator (see ferror()) on stdout. Example putchar with error checking. #include <stdio.h> #include <stdlib.h>

getwchar

Defined in header <wchar.h> wint_t getwchar(); (since C95) Reads the next wide character from stdin. Parameters (none). Return value the obtained wide character or WEOF if an error has occurred or the end of file reached. References C11 standard (ISO/IEC 9899:2011): 7.29.3.7 The getwchar function (p: 424) C99 standard (ISO/IEC 9899:1999): 7.24.3.7 The getwchar function (p: 369-370) See also getchar reads a character from stdin (function) fgetwcge

static

Usage static duration storage-class specifier with internal linkage at file scope and no linkage at block scope. static array indices in function parameter declarations. (since C99)

Basic concepts

This section provides definitions for the specific terminology and the concepts used when describing the C programming language. A C program is a sequence of text files (typically header and source files) that contain declarations. They undergo translation to become an executable program, which is executed when the OS calls its main function (unless it is itself the OS or another freestanding program, in which case the entry point is implementation-defined). Certain words in a C program have sp