_Generic

Usage Type-generic expression

puts

Defined in header <stdio.h> int puts( const char *str ); Writes character string str and a newline to stdout. Parameters str - character string to be written Return value non-negative number on success or EOF otherwise. Example puts() with error checking. #include <stdio.h> #include <stdlib.h> int main(void) { int ret_code = puts("Hello World"); if ((ret_code == EOF) && (ferror(stdout))) /* test whether EOF was reached */

crealf

Defined in header <complex.h> float crealf( float complex z ); (1) (since C99) double creal( double complex z ); (2) (since C99) long double creall( long double complex z ); (3) (since C99) Defined in header <tgmath.h> #define creal( z ) (4) (since C99) 1-3) Returns the real part of z. 4) Type-generic macro: if z has type long double complex, long double imaginary, or long double, creall is called. If z has type float complex, flo

Lookup and name spaces

When an identifier is encountered in a C program, a lookup is performed to locate the declaration that introduced that identifier and that is currently in scope. C allows more than one declaration for the same identifier to be in scope simultaneously if these identifiers belong to different categories, called name spaces: 1) Label name space: all identifiers declared as labels. 2) Tag names: all identifiers declared as names of structs, unions and enumerated types. Note that all three kinds o

fgetc

Defined in header <stdio.h> int fgetc( FILE *stream ); int getc( FILE *stream ); Reads the next character from the given input stream. getc() may be implemented as a macro. Parameters stream - to read the character from Return value The obtained character on success or EOF on failure. If the failure has been caused by end-of-file condition, additionally sets the eof indicator (see feof()) on stream. If the failure has been caused by some other error, set

localeconv

Defined in header <locale.h> lconv* localeconv(); The localeconv function obtains a pointer to a static object of type lconv, which represents numeric and monetary formatting rules of the current C locale. Parameters (none). Return value pointer to the current lconv object. Notes Modifying the object references through the returned pointer is undefined behavior. localeconv modifies a static object, calling it from different threads without synchronization is undefi

SIG_DFL

Defined in header <signal.h> #define SIG_DFL /*implementation defined*/ #define SIG_IGN /*implementation defined*/ The SIG_DFL and SIG_IGN macros expand into integral expressions that are not equal to an address of any function. The macros define signal handling strategies for signal() function. Constant Explanation SIG_DFL default signal handling SIG_IGN signal is ignored Example #include <signal.h> #include <stdio.h> int main(void) {

at_quick_exit

Defined in header <stdlib.h> int at_quick_exit( void (*func)() ); (since C11) Registers the function pointed to by func to be called on quick program termination (via quick_exit). Calling the function from several threads does not induce a data race. The implementation shall support the registration of at least 32 functions. Parameters func - pointer to a function to be called on normal program termination Return value ​0​ if the registration succeeds, nonzero

SIGTERM

Defined in header <signal.h> #define SIGTERM /*implementation defined*/ #define SIGSEGV /*implementation defined*/ #define SIGINT /*implementation defined*/ #define SIGILL /*implementation defined*/ #define SIGABRT /*implementation defined*/ #define SIGFPE /*implementation defined*/ Each of the above macro constants expands to an integer constant expression with distinct values, which represent different signals sent to the program. Constant

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