wcstok

Defined in header <wchar.h> (1) wchar_t* wcstok( wchar_t* str, const wchar_t* delim, wchar_t **ptr ); (since C95) (until C99) wchar_t *wcstok(wchar_t * restrict str, const wchar_t * restrict delim, wchar_t **restrict ptr); (since C99) wchar_t *wcstok_s( wchar_t *restrict str, rsize_t *restrict strmax, const wchar_t *restrict delim, wchar_t **restrict ptr); (2) (since C11) 1) Finds the next token in a null-terminated wide strin

Null-terminated multibyte strings

A null-terminated multibyte string (NTMBS), or "multibyte string", is a sequence of nonzero bytes followed by a byte with value zero (the terminating null character). Each character stored in the string may occupy more than one byte. The encoding used to represent characters in a multibyte character string is locale-specific: it may be UTF-8, GB18030, EUC-JP, Shift-JIS, etc. For example, the char array {'\xe4','\xbd','\xa0','\xe5','\xa5','\xbd','\0'} is an NTMBS holding the string "你好" in UTF-8

exit

Defined in header <stdlib.h> void exit( int exit_code ); (until C11) _Noreturn void exit( int exit_code ); (since C11) Causes normal program termination to occur. Several cleanup steps are performed: functions passed to atexit are called, in reverse order of registration all C streams are flushed and closed files created by tmpfile are removed control is returned to the host environment. If exit_code is zero or EXIT_SUCCESS, an implementation-defined status, in

Implicit conversions

When an expression is used in the context where a value of a different type is expected, conversion may occur: int n = 1L; // expression 1L has type long, int is expected n = 2.1; // expression 2.1 has type double, int is expected char *p = malloc(10); // expression malloc(10) has type void*, char* is expected Conversions take place in the following situations: Conversion as if by assignment In the assignment operator, the value of the right-hand operand is converted to the unqualified type

wcstombs

Defined in header <stdlib.h> (1) size_t wcstombs( char *dst, const wchar_t *src, size_t len ); (until C99) size_t wcstombs( char *restrict dst, const wchar_t *restrict src, size_t len ); (since C99) errno_t wcstombs_s( size_t *restrict retval, char *restrict dst, rsize_t dstsz, const wchar_t *restrict src, rsize_t len ); (2) (since C11) 1) Converts a sequence of wide characters from the array whose first element is pointed

wcstof

Defined in header <wchar.h> float wcstof( const wchar_t* str, wchar_t** str_end ); (since C99) double wcstod( const wchar_t* str, wchar_t** str_end ); (since C95) long double wcstold( const wchar_t* str, wchar_t** str_end ); (since C99) Interprets a floating point value in a wide string pointed to by str. Function discards any whitespace characters (as determined by std::isspace()) until first non-whitespace character is found. Then it takes as many c

malloc

Defined in header <stdlib.h> void* malloc( size_t size ); Allocates size bytes of uninitialized storage. If allocation succeeds, returns a pointer to the lowest (first) byte in the allocated memory block that is suitably aligned for any object type. If size is zero, the behavior is implementation defined (null pointer may be returned, or some non-null pointer may be returned that may not be used to access storage). malloc is thread-safe: it behaves as though only accessing

strerror

Defined in header <string.h> char* strerror( int errnum ); (1) errno_t strerror_s( char *buf, rsize_t bufsz, errno_t errnum ); (2) (since C11) size_t strerrorlen_s( errno_t errnum ); (3) (since C11) 1) Returns a pointer to the textual description of the system error code errnum, identical to the description that would be printed by perror(). errnum is usually acquired from the errno variable, however the function accepts any value of type int. The contents of

rand

Defined in header <stdlib.h> int rand(); Returns a pseudo-random integral value between ​0​ and RAND_MAX (0 and RAND_MAX included). srand() seeds the pseudo-random number generator used by rand(). If rand() is used before any calls to srand(), rand() behaves as if it was seeded with srand(1). Each time rand() is seeded with srand(), it must produce the same sequence of values. rand() is not guaranteed to be thread-safe. Parameters (none). Return value Pseudo-random in

log10

Defined in header <math.h> float log10f( float arg ); (1) (since C99) double log10( double arg ); (2) long double log10l( long double arg ); (3) (since C99) Defined in header <tgmath.h> #define log10( arg ) (4) (since C99) 1-3) Computes the common (base-10) logarithm of arg. 4) Type-generic macro: If arg has type long double, log10l is called. Otherwise, if arg has integer type or the type double, log10 is called. Otherwise, log10