imaginary

Defined in header <complex.h> #define imaginary _Imaginary (since C99) This macro expands to the keyword _Imaginary. This is a convenience macro that makes it possible to use float imaginary, double imaginary, and long double imaginary as an alternative way to write the three pure imaginary C types float _Imaginary, double _Imaginary, and long double _Imaginary. As with any pure imaginary number support in C, this macro is only defined if the imaginary numbers are supported

ferror

Defined in header <stdio.h> int ferror( FILE *stream ); Checks the given stream for errors. Parameters stream - the file stream to check Return value Nonzero value if the file stream has errors occurred, ​0​ otherwise. Example #include <stdio.h> #include <stdlib.h> int main(void) { FILE* fp = fopen("test.txt", "r"); if(!fp) { perror("File opening failed"); return EXIT_FAILURE; } int c; // note: int, not char

ptrdiff_t

Defined in header <stddef.h> typedef /*implementation-defined*/ ptrdiff_t; ptrdiff_t is the signed integer type of the result of subtracting two pointers. Notes ptrdiff_t is used for pointer arithmetic and array indexing, if negative values are possible. Programs that use other types, such as int, may fail on, e.g. 64-bit systems when the index exceeds INT_MAX or if it relies on 32-bit modular arithmetic. Only pointers to elements of the same array (including the pointer

while loop

Executes a statement repeatedly, until the value of expression becomes equal to zero. The test takes place before each iteration. Syntax while ( expression ) statement expression - any expression of scalar type. This expression is evaluated before each iteration, and if it compares equal to zero, the loop is exited. statement - any statement, typically a compound statement, which serves as the body of the loop Explanation A while statement causes the statement (also

return

Usage return statement: as the declaration of the statement

signal

Defined in header <signal.h> void (*signal( int sig, void (*handler) (int))) (int); Sets the error handler for signal sig. The signal handler can be set so that default handling will occur, signal is ignored, or an user-defined function is called. When signal handler is set to a function and a signal occurs, it is implementation defined whether signal(sig, SIG_DFL) will be executed immediately before the start of signal handler. Also, the implementation can prevent some imp

printf

Defined in header <stdio.h> (1) ​int printf( const char *format, ... );​ (until C99) ​int printf( const char *restrict format, ... );​ (since C99) (2) int fprintf( FILE *stream, const char *format, ... ); (until C99) int fprintf( FILE *restrict stream, const char *restrict format, ... ); (since C99) (3) int sprintf( char *buffer, const char *format, ... ); (until C99) int sprintf( char *restrict buffer, const char *restrict format, ... ); (since C

C keywords

This is a list of reserved keywords in C. Since they are used by the language, these keywords are not available for re-definition. autobreakcasecharconstcontinuedefaultdodoubleelseenumextern. floatforgotoifinline (since C99)intlongregisterrestrict (since C99)returnshort. signedsizeofstaticstructswitchtypedefunionunsignedvoidvolatilewhile. _Alignas (since C11)_Alignof (since C11)_Atomic (since C11)_Bool (since C99)_Complex (since C99)_Generic (since C11)_Imaginary (since C99)_Noreturn (si

fputc

Defined in header <stdio.h> int fputc( int ch, FILE *stream ); int putc( int ch, FILE *stream ); Writes a character ch to the given output stream stream. putc() may be implemented as a macro and evaluation stream more than once, so the corresponding argument should never be an expression with side effects. Internally, the character is converted to unsigned char just before being written. Parameters ch - character to be written stream - output stream

atomic_signal_fence

Defined in header <stdatomic.h> void atomic_signal_fence( memory_order order ); (since C11) Establishes memory synchronization ordering of non-atomic and relaxed atomic accesses, as instructed by order, between a thread and a signal handler executed on the same thread. This is equivalent to std::atomic_thread_fence, except no CPU instructions for memory ordering are issued. Only reordering of the instructions by the compiler is suppressed as order instructs. For example, wr