getwchar

Defined in header <wchar.h> wint_t getwchar(); (since C95) Reads the next wide character from stdin. Parameters (none). Return value the obtained wide character or WEOF if an error has occurred or the end of file reached. References C11 standard (ISO/IEC 9899:2011): 7.29.3.7 The getwchar function (p: 424) C99 standard (ISO/IEC 9899:1999): 7.24.3.7 The getwchar function (p: 369-370) See also getchar reads a character from stdin (function) fgetwcge

gets

Defined in header <stdio.h> char *gets( char *str ); (until C11) char *gets_s( char *str, rsize_t n ); (since C11) (optional) 1) Reads stdin into the character array pointed to by str until a newline character is found or end-of-file occurs. A null character is written immediately after the last character read into the array. The newline character is discarded but not stored in the buffer. 2) Reads characters from stdin until a newline is found or end-of-file occurs

getenv

Defined in header <stdlib.h> char *getenv( const char *name ); (1) errno_t getenv_s( size_t *restrict len, char *restrict value, rsize_t valuesz, const char *restrict name ); (2) (since C11) 1) Searches for an environmental variable with name name in the host-specified environment list and returns a pointer to the string that is associated with the matched environment variable. The set of environmental variables and methods of altering it are implem

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&

Generic selection

Provides a way to choose one of several expressions at compile time, based on a type of a controlling expression. Syntax _Generic ( controlling-expression , association-list ) (since C11) where association-list is a comma-separated list of associations, each of which has the syntax. type-name : expression default : expression where. type-name - any complete object type that isn't variably-modified (that is, not VLA or pointer to VLA). controlling-expression -

fwrite

Defined in header <stdio.h> size_t fwrite( const void *buffer, size_t size, size_t count, FILE *stream ); (until C99) size_t fwrite( const void *restrict buffer, size_t size, size_t count, FILE *restrict stream ); (since C99) Writes count of objects in the given array buffer to the output stream stream. Objects are not interpreted in any way. Parameters buffer - pointer to the first object object in the array to be written size

fwide

Defined in header <wchar.h> int fwide( FILE *stream, int mode ); (since C95) If mode > 0, attempts to make stream wide-oriented. If mode < 0, attempts to make stream byte-oriented. If mode==0, only queries the current orientation of the stream. If the orientation of the stream has already been decided (by executing output or by an earlier call to fwide), this function does nothing. Parameters stream - pointer to the C I/O stream to modify or query mode -

Functions

A function is a C language construct that associates a compound statement (the function body) with an identifier (the function name). Every C program begins execution from the main function, which either terminates, or invokes other, user-defined or library functions. // function definition. // defines a function with the name "sum" and with the body "{ return x+y; }" int sum(int x, int y) { return x + y; } Functions may accept zero or more parameters, which are initialized from the argume

Function definitions

A function definition associates the function body (a sequence of declarations and statements) with the function name and parameter list. Unlike function declaration, function definitions are allowed at file scope only (there are no nested functions). C supports two different forms of function definitions: specifiers-and-qualifiers parameter-list-declarator function-body (1) specifiers-and-qualifiers identifier-list-declarator declaration-list function-body (2) where. specifiers-

Function declarations

A function declaration introduces an identifier that designates a function and, optionally, speicifies the types of the function parameters (the prototype). Function declarations (unlike definitions) may appear at block scope as well as file scope. Syntax In the declaration grammar of an function declaration, the type-specifier sequence, possibly modified by the declarator, designates the return type (which may be any type other than array or function type), and the declarator has one of two