MATH_ERRNO

Defined in header <math.h> #define MATH_ERRNO 1 (since C99) #define MATH_ERREXCEPT 2 (since C99) #define math_errhandling /*implementation defined*/ (since C99) The macro constant math_errhandling expands to an expression of type int that is either equal to MATH_ERRNO, or equal to MATH_ERREXCEPT, or equal to their bitwise OR (MATH_ERRNO | MATH_ERREXCEPT). The value of math_errhandling indicates the type of error handling that is performed by the float

feclearexcept

Defined in header <<fenv.h>> int feclearexcept( int excepts ); (since C99) Attempts to clear the floating-point exceptions that are listed in the bitmask argument excepts, which is a bitwise OR of the floating point exception macros. Parameters excepts - bitmask listing the exception flags to clear Return value ​0​ if all indicated exceptions were successfully cleared or if excepts is zero. Returns a non-zero value on error. Example #include <fen

hypot

Defined in header <math.h> float hypotf( float x, float y ); (1) (since C99) double hypot( double x, double y ); (2) (since C99) long double hypotl( long double x, long double y ); (3) (since C99) Defined in header <tgmath.h> #define hypot( x, y ) (4) (since C99) 1-3) Computes the square root of the sum of the squares of x and y, without undue overflow or underflow at intermediate stages of the computation. 4) Type-generic macro:

wcrtomb

Defined in header <wchar.h> size_t wcrtomb( char *s, wchar_t wc, mbstate_t *ps); (1) (since C95) errno_t wcrtomb_s(size_t *restrict retval, char *restrict s, rsize_t ssz, wchar_t wc, mbstate_t *restrict ps); (2) (since C11) Converts a wide character to its narrow multibyte representation. 1) If s is not a null pointer, the function determines the number of bytes necessary to store the multibyte character representation of wc (including any shift seq

strcpy

Defined in header <string.h> (1) char *strcpy( char *dest, const char *src ); (until C99) char *strcpy( char *restrict dest, const char *restrict src ); (since C99) errno_t strcpy_s(char *restrict dest, rsize_t destsz, const char *restrict src); (2) (since C11) 1) Copies the null-terminated byte string pointed to by src, including the null terminator, to the character array whose first element is pointed to by dest. The behavior is undefined if the dest array

wprintf

Defined in header <wchar.h> int wprintf( const wchar_t* format, ... ); (1) (since C95) int fwprintf( FILE *stream, const wchar_t* format, ... ); (2) (since C95) int swprintf( wchar_t *buffer, size_t bufsz, const wchar_t* format, ... ); (3) (since C95) int wprintf_s( const wchar_t *restrict format, ...); (4) (since C11) int fwprintf_s( FILE *restrict stream, const wchar_t *restrict format, ...); (5) (since C11) int swprint

thrd_join

Defined in header <threads.h> int thrd_join( thrd_t thr, int *res ); (since C11) Blocks the current thread until the thread identified by thr finishes execution. If res is not a null pointer, the result code of the thread is put to the location pointed to by res. The termination of the thread synchronizes-with the completion of this function. The behavior is undefined if the thread was previously detached or joined by another thread. Parameters thr - identifier of t

clearerr

Defined in header <stdio.h> void clearerr( FILE *stream ); Resets the error flags and the EOF indicator for the given file stream. Parameters stream - the file to reset the error flags for Return value (none). Example clearerr resets the EOF indicator. #include <stdio.h> #include <stdlib.h> int main(void) { FILE* tmpf = tmpfile(); fputs("abcde\n", tmpf); rewind(tmpf); int ch; while ((ch=fgetc(tmpf)) != EOF) /* read/pri

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

getchar

Defined in header <stdio.h> int getchar(); Reads the next character from stdin. Equivalent to getc(stdin). Parameters (none). 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 stdin. If the failure has been caused by some other error, sets the error indicator (see ferror()) on stdin. Example getchar with error checking. #include <stdio.h&