strcat

Defined in header <string.h> (1) char *strcat( char *dest, const char *src ); (until C99) char *strcat( char *restrict dest, const char *restrict src ); (since C99) errno_t strcat_s(char *restrict dest, rsize_t destsz, const char *restrict src); (2) (since C11) 1) Appends a copy of the null-terminated byte string pointed to by src to the end of the null-terminated byte string pointed to by dest. The character src[0] replaces the null terminator at the end of de

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

static_assert

Defined in header <assert.h> #define static_assert _Static_assert This convenience macro expands to the keyword _Static_assert. Example #include <assert.h> int main(void) { static_assert(2 + 2 == 4, "2+2 isn't 4"); // well-formed static_assert(sizeof(int) < sizeof(char), "this program requires that int is less than char"); // compile-time error } References C11 standard (ISO/IEC 9899:2011): 7.2/3 Diagnostics <assert.h>

Static storage duration

An object whose identifier is declared without the storage-class specifier _Thread_local, and either with external or internal linkage or with the storage-class specifier static, has static storage duration. Its lifetime is the entire execution of the program and its stored value is initialized only once, prior to program startup. Notes Since its stored value is initialized only once, an object with static storage duration can profile the invocations of a function. The other use of the keywo

static assert declaration

Syntax _Static_assert ( expression , message ) (since C11) expression - any integer constant expression message - any string literal This keyword is also available as convenience macro static_assert, available in the header <assert.h>. Explanation The constant expression is evaluated at compile time and compared to zero. If it compares equal to zero, a compile-time error occurs and the compiler must display message as part of the error message (except that char

static

Usage static duration storage-class specifier with internal linkage at file scope and no linkage at block scope. static array indices in function parameter declarations. (since C99)

Statements

Statements are fragments of the C program that are executed in sequence. The body of any function is a compound statement, which, in turn is a sequence of statements and declarations: int main(void) { // start of a compound statement int n = 1; // declaration (not a statement) n = n+1; // expression statement printf("n = %d\n", n); // expression statement return 0; // return statement } // end of compound statement, end of function body There are five types of statements: 1) c

srand

Defined in header <stdlib.h> void srand( unsigned seed ); Seeds the pseudo-random number generator used by rand() with the value seed. 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. srand() is not guaranteed to be thread-safe. Parameters seed - the seed value Return value (none). Notes Generally speaking, the pseudo-random

sqrt

Defined in header <math.h> float sqrtf( float arg ); (1) (since C99) double sqrt( double arg ); (2) long double sqrtl( long double arg ); (3) (since C99) Defined in header <tgmath.h> #define sqrt( arg ) (4) (since C99) 1-3) Computes square root of arg. 4) Type-generic macro: If arg has type long double, sqrtl is called. Otherwise, if arg has integer type or the type double, sqrt is called. Otherwise, sqrtf is called. If arg is com

size_t

Defined in header <stddef.h> Defined in header <stdio.h> Defined in header <string.h> Defined in header <time.h> typedef /*implementation-defined*/ size_t; size_t is the unsigned integer type of the result of sizeof , alignof (since C11) and offsetof. Notes size_t can store the maximum size of a theoretically possible object of any type (including array). size_t is commonly used for array indexing and loop counting. Programs that us