va_start

Defined in header <stdarg.h> void va_start( va_list ap, parmN ); The va_start macro enables access to the variable arguments following the named argument parmN. va_start should be invoked with an instance to a valid va_list object ap before any calls to va_arg. If parmN is declared with register storage class specifier, with an array type, with a function type, or with a type not compatible with the type that results from default argument promotions, the behavior is undefin

volatile type qualifier

Each individual type in the C type system has several qualified versions of that type, corresponding to one, two, or all three of the const, volatile, and, for pointers to object types, restrict qualifiers. This page describes the effects of the volatile qualifier. Every access (both read and write) made through an lvalue expression of volatile-qualified type is considered an observable side effect for the purpose of optimization and is evaluated strictly according to the rules of the abstract

va_copy

Defined in header <stdarg.h> void va_copy( va_list dest, va_list src ); (since C99) The va_copy macro copies src to dest. va_end should be called on dest before the function returns or any subsequent re-initialization of dest (via calls to va_start or va_copy). Parameters dest - an instance of the va_list type to initialize src - the source va_list that will be used to initialize dest Expanded value (none). Example #include <stdio.h> #include

Variadic functions

Variadic functions are functions (e.g. printf) which take a variable number of arguments. The declaration of a variadic function uses an ellipsis as the last parameter, e.g. int printf(const char* format, ...);. See variadic arguments for additional detail on the syntax and automatic argument conversions. Accessing the variadic arguments from the function body uses the following library facilities: Macros Defined in header <stdarg.h> va_start enables access to variadic funct

Value categories

Each expression in C (an operator with its arguments, a function call, a constant, a variable name, etc) is characterized by two independent properties: a type and a value category. Every expression belongs to one of three primary categories: lvalues, function designators, and non-lvalue object expressions (rvalues). Lvalue expressions Lvalue expression is any expression with object type other than the type void, which potentially designates an object (the behavior is undefined if an lvalue

Variadic arguments

Variadic functions are functions that may be called with different number of arguments. Only new-style (prototyped) function declarations may be variadic. This is indicated by the parameter of the form ... which must appear last in the parameter list and must follow at least one named parameter. //New-style declaration int printx(const char* fmt, ...); // function declared this way printx("hello world"); // may be called with one printx("a=%d b=%d", a, b); // or more arguments // int printy(.

va_arg

Defined in header <stdarg.h> T va_arg( va_list ap, T ); The va_arg macro expands to an expression of type T that corresponds to the next parameter from the va_list ap. Prior to calling va_arg, ap must be initialized by a call to either va_start or va_copy, with no intervening call to va_end. Each invocation of the va_arg macro modifies ap to point to the next variable argument. If va_arg is called when there are no more arguments in ap, or if the type of the next argument i

union

Usage declaration of a union type

unsigned

Usage unsigned type modifier

ungetc

Defined in header <stdio.h> int ungetc( int ch, FILE *stream ); Puts the character ch back to the given file stream. Parameters ch - character to be put back stream - file stream to put the character back to Return value On success ch is returned. On failure EOF is returned and the given stream remains unchanged. Example ungetc with error checking. #include <stdio.h> #include <stdlib.h> int main(void) { FILE* fp = fopen("test.txt",