Constant expressions

Several varieties of expressions are known as constant expressions. Preprocessor constant expression The expression following #if or #elif must expand to. operators other than assignment, increment, decrement, function-call, or comma whose arguments are preprocessor constant expressions integer constants character constants the special preprocessor operator defined Character constants, when evaluated in #if-expressions, may be interpreted in the source character set, the execution

Storage-class specifiers

Specify storage duration and linkage of objects and functions: auto - automatic duration and no linkage register - automatic duration and no linkage; address of this variable cannot be taken static - static duration and internal linkage (unless at block scope) extern - static duration and external linkage (unless already declared internal) _Thread_local - thread storage duration (since C11) Explanation Storage-class specifiers appear in declarations. At most one specifier may

rewind

Defined in header <stdio.h> void rewind( FILE *stream ); Moves the file position indicator to the beginning of the given file stream. The function is equivalent to fseek(stream, 0, SEEK_SET);, except that end-of-file and error indicators are cleared. The function drops any effects from previous calls to ungetc. Parameters stream - file stream to modify Return value (none). Example This example shows how to read a file twice. #include <stdio.h> char

remove

Defined in header <stdio.h> int remove( const char *fname ); Deletes the file identified by character string pointed to by fname. If the file is currently open by this or another process, the behavior of this function is implementation-defined (in particular, POSIX systems unlink the file name although the file system space is not reclaimed until the last running process closes the file; Windows does not allow the file to be deleted). Parameters fname - pointer to a

strpbrk

Defined in header <string.h> char* strpbrk( const char* dest, const char* breakset ); Scans the null-terminated byte string pointed to by dest for any character from the null-terminated byte string pointed to by breakset, and returns a pointer to that character. The behavior is undefined if either dest or breakset is not a pointer to a null-terminated byte string. Parameters dest - pointer to the null-terminated byte string to be analyzed breakset - pointer to

wcsrchr

Defined in header <wchar.h> wchar_t* wcsrchr( const wchar_t* str, wchar_t ch ); (since C95) Finds the last occurrence of the wide character ch in the wide string pointed to by str. Parameters str - pointer to the null-terminated wide string to be analyzed ch - wide character to search for Return value Pointer to the found character in str, or NULL if no such character is found. Example References C11 standard (ISO/IEC 9899:2011): 7.29.4.5.4 The w

wctob

Defined in header <wchar.h> int wctob( wint_t c ); (since C95) Narrows a wide character c if its multibyte character equivalent in the initial shift state is a single byte. This is typically possible for the characters from the ASCII character set, since most multibyte encodings (such as UTF-8) use single bytes to encode those characters. Parameters c - wide character to narrow Return value EOF if c does not represent a multibyte character with length 1 in ini

mbstowcs

Defined in header <stdlib.h> (1) size_t mbstowcs( wchar_t *dst, const char *src, size_t len) (until C99) size_t mbstowcs( wchar_t *restrict dst, const char *restrict src, size_t len) (since C99) errno_t mbstowcs_s(size_t *restrict retval, wchar_t *restrict dst, rsize_t dstsz, const char *restrict src, rsize_t len); (2) (since C11) 1) Converts a multibyte character string from the array whose first element is pointed to by src

ATOMIC_VAR_INIT

Defined in header <stdatomic.h> #define ATOMIC_VAR_INIT(value) /* unspecified */ (since C11) Expands to an expression that can be used to initialize an atomic variable of the same type as value. The initial value of atomic object of automatic storage duration that is not initialized using this macro is undefined. The default (zero) initialization of static and thread-local variables produces valid value however. If this macro is not used for initialization of an atomic vari

NULL

Defined in header <stddef.h> Defined in header <string.h> Defined in header <wchar.h> Defined in header <time.h> Defined in header <locale.h> Defined in header <stdio.h> #define NULL /*implementation-defined*/ Expands into implementation-defined null-pointer constant. Example #include <stdlib.h> struct S; void(*f)() = NULL; int main(void) { char *ptr = malloc(sizeof(char)*10); if (pt