C Programming Language Summary

ECE 8473, Fall 2022


Table of Contents


1. Standards

The C Programming Language was originally defined in the book by Brian Kernighan and Dennis Ritchie in 1978 (K&R C).

The book was revised in 1988 to reflect the first standards, ANSI X3.159-1989 and ISO/IEC 9899:1990, which are identical except for section numbering (ANSI C, C89, or C90).

The major change to C introduced in the C90 standard was the addition of function prototypes.

C99 included many major changes to the original C89/90 standard.

C11 added atomic objects, threads, and unicode to the language.

C17 addresses defects in C11 without introducing new language features.


2. Core, Preprocessor, and Library

Three parts:

  1. The core C language

    44 keywords, 49 operators, plus punctuation characters and syntax rules

  2. The C preprocessor

    Lines starting with a pound-sign

        #define -- macros
        #include -- other source files
        #ifdef -- conditional compilation
    
  3. The C standard library

    29 parts, defined by standard headers:

    assert.h, ctype.h, errno.h, float.h, limits.h, locale.h, math.h, setjmp.h, signal.h, stdarg.h, stddef.h, stdio.h, stdlib.h, string.h, time.h

    complex.h, fenv.h, inttypes.h, iso646.h, stdbool.h, stdint.h, tgmath.h, wchar.h, wctype.h (C99)

    stdalign.h, stdatomic.h, stdnoreturn.h, threads.h, uchar.h (C11)


3. Preprocessor Examples

#include <stdio.h>

#ifdef unix
# include <unistd.h>
#else
# include <cygwin.h>
#endif

#include "myheader.h"

#define NMAX 100  /* K&R style comment */

#define SQR(x) ((x)*(x)) // C++ style comment

/* Comments do not nest */

/*
 * K&R style comments can span
 *  more than one line.
 */

4. Standard Library Headers

The standard library headers define macros and declare functions - cppreference.com/w/c/header

Sample from stdio.h:

  #define NULL   0		// see notes on NULL
  #define BUFSIZ 8192		// see notes on BUFSIZ and EOF
  #define EOF    (-1)

  int printf(const char *format, ...);
  int scanf(const char *format, ...);
Sample from errno.h:
  extern int errno;
Sample from math.h:
  double sqrt(double x);
  float sqrtf(float x);
  long double sqrtl(long double x);

  double sin(double x);

5. Keywords

44 keywords (reserved words) - cppreference.com/w/c/keyword

Three main groups:

  Data, Modifiers/Other, Control
Data Keywords
  void
  char
  int
  float
  double

  _Bool, _Complex, _Imaginary (C99)

  _Alignas, _Alignof, _Atomic, _Generic, _Noreturn, _Static_assert, _Thread_local (C11)
Examples:
  char c;
  char buf[10];
  int i, j;
  float f = 1.7e-3;
  double d;
  void func(int);

6. Modifier and Other Keywords

  long    short
  signed  unsigned
  auto    static    extern
  const   volatile  register

  struct  union     enum
  typedef
  sizeof

  inline  restrict (C99)
Examples:
  long int size;
  unsigned short int s;
  static double seed;

  struct student
  {
    char name[60];
    int test[4];
    double avg;
  };

  struct student sam;

  typedef struct student Student;

  Student class[100];

7. Control Keywords

  if    else   switch  case   default
  for   while  do      break  continue
  goto  return
Examples:
  if( a < b)
    min = a;
  else
    min = b;

  while( i < 10)
  {
    x = somefunc(i);
    if( x == 0)
      break;
    ++i;
  }

8. Operators

49 operators, 15 levels of precedence.

Associativity is left-to-right (LR) or right-to-left (RL).

In decreasing order of precedence:

  Assoc.  Operators
  ------  ---------
  LR      ()  []  ->  .  (type){list}  ++  --                         // postfix ++ -- ()
  RL      ++  --  +  -  !  ~  *  &  (type)  sizeof  _Alignof          // prefix ++ -- unary + -
  LR      *  /  %
  LR      +  -
  LR      <<  >>
  LR      <  <=  >  >=
  LR      ==  !=
  LR      &
  LR      ^
  LR      |
  LR      &&
  LR      ||
  RL      ?:
  RL      =  +=  -=  *=  /=  %= &=  ^=  |=  <<=  >>=
  LR      ,
(type){list} represents a compound literal, e.g. (int[]){2, 4}

(type) represents a cast, e.g. (double)i/j

See also en.cppreference.com/w/c/language/operator_precedence


9. Operand Evaluation Order

Not specified, except for && || ?: ,     (see also notes on sequence points)

Examples:

  x = f() + g();

  f may be evaluated before g or vice versa.

Similarly, the order in which function arguments are evaluated is not specified.

Note: associativity of addition is LR:

  x = f() + g() + h();
is equivalent to:
  x = (f() + g()) + h();
Logical AND:
  if( x != 0  &&  1/x < eps) ...

  1/x is not computed if x is zero.

Logical OR:

  if( x == 0  ||  f(x) == 0) ...

  f(x) is not computed if x is zero.

Conditional Operator:

  y = (a < b) ? f(x) : g(x);

  if a is less than b, then f(x) is executed and g(x) is not.

Comma Operator:

  ++i, ++j;

  ++i is executed first and the result is ignored.  ++j is executed second.

10. Comparison with Java

        keywords   operators  "packages"  classes  "things"
   C       44          49         29         -         990
Java       53          44        202       3777      43749
Counting the standard C library headers as "packages".

"things" in the standard C library are macros, functions, types, etc.

"things" in the standard Java classes are methods, constants, etc.

Unix/C "packages":

  % uname
  Linux
  % find /usr/include -name '*.h' -print | wc -l
  1248
  %
  ---
  % uname
  SunOS
  % find /usr/include -name '*.h' -print | wc -l
      5677
  %

11. Compound Statement

The executable statements types are:

compound, expression, selection, iteration, labeled, jump

Compound Statement

  {
    optional declarations, local vars, statements, ...
  }
A function body is a compound statement.

12. Expression Statement

  ;

  expression ;

13. Selection Statement

if, with optional else part; or switch
  if( a < b)
  {
    x = f(y);
    z = g(x);
  }

  switch( expr)
  {
    case 1: x=3; f(y); break;

    case 20: g(); break;

    default: p(); break;
  }

14. Iteration Statement

while, do...while, and for
  e1;
  while( e2)
  {
    stmt1;
    if( cond1) break;
    if( cond2) continue;
    e3;
  }

  for( e1; e2; e3)
  {
    stmt1;
    if( cond1) break;
    if( cond2) continue;
    stmt4;
  }
Note: continue in the while loop goes back to "while( e2)"; in the for loop, it goes to e3.
  do
  {
     statement_list...
  }
  while( condition);

15. Labeled Statement

  goto some_label;
  ...
  some_label: some_statement
case and default are labeled statements.

16. Jump Statement

  goto some_label;
  continue;
  break;
  return;
  return expression;

17. Translation Unit

Each file of C code, after preprocessing, is a translation unit.

A translation unit is a sequence of declarations and function definitions.

Executable statements appear in function bodies.

The main program is a function named main.

All function arguments are passed by value.

Example:

  #include <stdio.h>

  int i;
  int myfunc(int);

  int main( void)
  {
    int j;

    i = 3;
    j = myfunc(i);
    /* ... */

    return 0; /* success */
  }

18. Integer and Floating-point Constants

Integers starting with 0 are octal (base 8).

Integers starting with 0x (or 0X) are hex (base 16).

Optional L (or l) or LL (or ll) suffix specifies long or long long.

Optional U (or u) suffix specifies unsigned.

  i = 17;   i = 021;   i = 0x11;   // equivalent statements

  i = 17L;  i = 17U;   i = 17UL;

Floating-point constants contain a decimal point or exponent or both, and are double by default.

Hex notation with a (required) binary exponent may be used. Associated printf formats are %a, %A.

Optional F (or f) suffix specifies float.

Optional L (or l) suffix specifies long double.

  d = 1.7;   d = 17e-1;  d = 0.17e1;  // equivalent statements

  d = 1.7f;  d = 1.7L;

  d = 22.0;  d = 0x16.p0;  d = 0x1.6p4; // equivalent statements, see hex.c

C17 (pdf) - 6.4.4 Constants; 6.4.5 String literals

19. Character Constants

  'c'   for char
 L'c'   for wide char (wchar_t)
where c is a character or escape sequence.

Escape sequences

  \'    single quote
  \"    double quote
  \?    question mark
  \\    backslash
  \a    audible bell
  \b    backspace
  \f    formfeed
  \n    newline
  \r    carriage return
  \t    horizontal tab
  \v    vertical tab

  \ooo  octal escape sequence, e.g. '\0', '\12'

  \x##  hexadecimal escape sequence, e.g. '\xFF'

C17 (pdf) - 6.4.4 Constants; 6.4.5 String literals

20. String Literals

  "c..."    for array of char
 L"c..."    for array of wchar_t
where c... is a sequence of 0 or more characters or escape sequences.

A terminating zero byte ('\0') is supplied by the compiler.

String      Characters           strlen
------      ----------           ------
""          '\0'                    0
"a"         'a', '\0'               1
"abc"       'a', 'b', 'c', '\0'     3
Character Arrays
  char s[4];

  The characters are: s[0], s[1], s[2], s[3]

  strcpy( s, "abc");

C17 (pdf) - 6.4.4 Constants; 6.4.5 String literals

21. Arrays

One-dimensional arrays:
  int x[3];

  The elements are: x[0], x[1], x[2]

  for( i = 0;  i < 3;  ++i)
  {
    /* use x[i] ... */
  }
Two-dimensional arrays:
  int a[2][3];

  The elements are:

    a[0][0], a[0][1], a[0][2],
    a[1][0], a[1][1], a[1][2]

  a[0] is a pointer to the first row.
  a[1] is a pointer to the second row.

22. Preprocessing Directives

# if
# ifdef
# ifndef
# elif
# else
# endif
# include
# define
# undef
# line
# error
# pragma
Operators:

defined, _Pragma, #, ##

Predefined macro names:

__DATE__, __FILE__, __LINE__, __STDC__, __STDC_HOSTED__, __STDC_VERSION__, __TIME__

__STDC_ISO_10646__, __STDC_MB_MIGHT_NEQ_WC__, __STDC_UTF_16__, __STDC_UTF_32__, __STDC_ANALYZABLE__, __STDC_IEC_559__, __STDC_IEC_559_COMPLEX__, __STDC_LIB_EXT1__, __STDC_NO_ATOMICS__, __STDC_NO_COMPLEX__, __STDC_NO_THREADS__, __STDC_NO_VLA__

__VA_ARGS__


C17 (pdf) - 6.10 Preprocessing directives

See also cppreference.com/w/c/preprocessor


23. assert.h

Macro:

assert

(Uses macro: NDEBUG)


24. ctype.h

Functions:

isalnum, isalpha, iscntrl, isdigit, isgraph, islower, isprint, ispunct, isspace, isupper, isxdigit

tolower, toupper

isblank


Descriptions: ctype.h

25. errno.h

Macros:

EDOM, ERANGE

EILSEQ

int:

errno

26. float.h

Macros:

FLT_RADIX, FLT_ROUNDS

FLT_MANT_DIG, FLT_MIN_EXP, FLT_MAX_EXP
DBL_MANT_DIG, DBL_MIN_EXP, DBL_MAX_EXP
LDBL_MANT_DIG, LDBL_MIN_EXP, LDBL_MAX_EXP

FLT_DIG, FLT_MIN, FLT_MAX, FLT_EPSILON, FLT_MIN_10_EXP, FLT_MAX_10_EXP
DBL_DIG, DBL_MIN, DBL_MAX, DBL_EPSILON, DBL_MIN_10_EXP, DBL_MAX_10_EXP
LDBL_DIG, LDBL_MIN, LDBL_MAX, LDBL_EPSILON, LDBL_MIN_10_EXP, LDBL_MAX_10_EXP

DECIMAL_DIG, FLT_EVAL_METHOD

FLT_DECIMAL_DIG, DBL_DECIMAL_DIG, LDBL_DECIMAL_DIG (C11)

FLT_TRUE_MIN, DBL_TRUE_MIN, LDBL_TRUE_MIN (C11)

FLT_HAS_SUBNORM, DBL_HAS_SUBNORM, LDBL_HAS_SUBNORM (C11)


C17 (pdf) - 5.2.4.2.2 Characteristics of floating types <float.h>

IEEE Floating Point - notes from Hennessy and Patterson, Appendix J, 2011.


27. limits.h

Macros:

CHAR_BIT, MB_LEN_MAX

CHAR_MIN, CHAR_MAX
SCHAR_MIN, SCHAR_MAX, UCHAR_MAX
SHRT_MIN, SHRT_MAX, USHRT_MAX
INT_MIN, INT_MAX, UINT_MAX
LONG_MIN, LONG_MAX, ULONG_MAX

LLONG_MIN, LLONG_MAX, ULLONG_MAX


C17 (pdf) - 5.2.4.2.1 Sizes of integer types <limits.h>

28. locale.h

Macros:

NULL
LC_ALL, LC_COLLATE, LC_CTYPE, LC_MONETARY, LC_NUMERIC, LC_TIME

Structure:

struct lconv

Functions:

setlocale, localeconv

29. math.h

Pragma:

FP_CONTRACT

Macros:

HUGE_VAL

FP_FAST_FMA, FP_FAST_FMAF, FP_FAST_FMAL, FP_ILOGB0, FP_ILOGBNAN, FP_INFINITE, FP_NAN, FP_NORMAL, FP_SUBNORMAL, FP_ZERO, HUGE_VALF, HUGE_VALL, INFINITY, MATH_ERREXCEPT, MATH_ERRNO, NAN, math_errhandling

Types:

double_t, float_t

Functions:

acos, asin, atan, atan2, ceil, cos, cosh, exp, fabs, floor, fmod, frexp, ldexp, log, log10, modf, pow, sin, sinh, sqrt, tan, tanh

acosf, acosh, acoshf, acoshl, acosl, asinf, asinh, asinhf, asinhl, asinl, atan2f, atan2l, atanf, atanh, atanhf, atanhl, atanl, cbrt, cbrtf, cbrtl, ceilf, ceill, copysign, copysignf, copysignl, cosf, coshf, coshl, cosl, erf, erfc, erfcf, erfcl, erff, erfl, exp2, exp2f, exp2l, expf, expl, expm1, expm1f, expm1l, fabsf, fabsl, fdim, fdimf, fdiml, floorf, floorl, fma, fmaf, fmal, fmax, fmaxf, fmaxl, fmin, fminf, fminl, fmodf, fmodl, fpclassify, frexpf, frexpl, hypot, hypotf, hypotl, ilogb, ilogbf, ilogbl, isfinite, isgreater, isgreaterequal, isinf, isless, islessequal, islessgreater, isnan, isnormal, isunordered, ldexpf, ldexpl, lgamma, lgammaf, lgammal, llrint, llrintf, llrintl, llround, llroundf, llroundl, log10f, log10l, log1p, log1pf, log1pl, log2, log2f, log2l, logb, logbf, logbl, logf, logl, lrint, lrintf, lrintl, lround, lroundf, lroundl, modff, modfl, nan, nanf, nanl, nearbyint, nearbyintf, nearbyintl, nextafter, nextafterf, nextafterl, nexttoward, nexttowardf, nexttowardl, powf, powl, remainder, remainderf, remainderl, remquo, remquof, remquol, rint, rintf, rintl, round, roundf, roundl, scalbln, scalblnf, scalblnl, scalbn, scalbnf, scalbnl, signbit, sinf, sinhf, sinhl, sinl, sqrtf, sqrtl, tanf, tanhf, tanhl, tanl, tgamma, tgammaf, tgammal, trunc, truncf, truncl

See also en.cppreference.com/w/c/numeric/math


30. setjmp.h

Macro:

setjmp

Type:

jmp_buf

Function:

longjmp

31. signal.h

Macros:

SIG_DFL, SIG_ERR, SIG_IGN

SIGABRT, SIGFPE, SIGILL, SIGINT, SIGSEGV, SIGTERM

Type:

sig_atomic_t

Functions:

signal, raise

C17 (pdf) - 7.14 Signal handling <signal.h>

32. stdarg.h

Macros:

va_start, va_arg, va_end

va_copy

Type:

va_list

33. stddef.h

Macros:

NULL, offsetof

Types:

ptrdiff_t, size_t, wchar_t

34. stdio.h

Macros:

BUFSIZ, EOF, FILENAME_MAX, FOPEN_MAX, L_tmpnam, NULL, SEEK_CUR, SEEK_END, SEEK_SET, TMP_MAX, _IOFBF, _IOLBF, _IONBF, stderr, stdin, stdout

Types:

FILE, fpos_t, size_t

Functions:

clearerr, fclose, feof, ferror, fflush, fgetc, fgetpos, fgets, fopen, fprintf, fputc, fputs, fread, freopen, fscanf, fseek, fsetpos, ftell, fwrite, getc, getchar, gets, perror, printf, putc, putchar, puts, remove, rename, rewind, scanf, setbuf, setvbuf, sprintf, sscanf, tmpfile, tmpnam, ungetc, vfprintf, vprintf, vsprintf

snprintf, vfscanf, vscanf, vsnprintf, vsscanf


35. stdlib.h

Macros:

NULL, RAND_MAX, MB_CUR_MAX
EXIT_FAILURE, EXIT_SUCCESS

Types:

div_t, ldiv_t, size_t, wchar_t

lldiv_t

Functions:

abort, abs, atexit, atof, atoi, atol, bsearch, calloc, div, exit, free, getenv, labs, ldiv, malloc, mblen, mbstowcs, mbtowc, qsort, rand, realloc, srand, strtod, strtol, strtoul, system, wcstombs, wctomb

_Exit, atoll, llabs, lldiv, strtof, strtold, strtoll, strtoull


C99 (pdf) - 7.20.2 Pseudo-random sequence generation functions
C99 (pdf) - 7.20.3 Memory management functions

36. string.h

Macro:

NULL

Type:

size_t

Functions:

memchr, memcmp, memcpy, memmove, memset, strcat, strchr, strcmp, strcoll, strcpy, strcspn, strerror, strlen, strncat, strncmp, strncpy, strpbrk, strrchr, strspn, strstr, strtok, strxfrm

C99 (pdf) - 7.21 String handling <string.h>

37. time.h

Macros:

CLOCKS_PER_SEC, NULL

Structure:

struct tm

Types:

clock_t, size_t, time_t

Functions:

asctime, clock, ctime, difftime, gmtime, localtime, mktime, strftime, time

C99 (pdf) - 7.23 Date and time <time.h> - summary.txt

38. complex.h (C99)

Pragma:

CX_LIMITED_RANGE

Macros:

I, _Complex_I, _Imaginary_I, complex, imaginary

CMPLX, CMPLXF, CMPLXL (C11)

Functions:

cabs, cabsf, cabsl, cacos, cacosf, cacosh, cacoshf, cacoshl, cacosl, carg, cargf, cargl, casin, casinf, casinh, casinhf, casinhl, casinl, catan, catanf, catanh, catanhf, catanhl, catanl, ccos, ccosf, ccosh, ccoshf, ccoshl, ccosl, cexp, cexpf, cexpl, cimag, cimagf, cimagl, clog, clogf, clogl, conj, conjf, conjl, cpow, cpowf, cpowl, cproj, cprojf, cprojl, creal, crealf, creall, csin, csinf, csinh, csinhf, csinhl, csinl, csqrt, csqrtf, csqrtl, ctan, ctanf, ctanh, ctanhf, ctanhl, ctanl

If C11 CMPLX macros are not available (e.g. older versions of gcc) use __builtin_complex:
  #ifndef CMPLX
  #define CMPLX(x,y) __builtin_complex((x),(y))
  #endif

39. fenv.h (C99)

Pragma:

FENV_ACCESS

Macros:

FE_DFL_ENV
FE_ALL_EXCEPT, FE_DIVBYZERO, FE_INEXACT, FE_INVALID, FE_OVERFLOW, FE_UNDERFLOW
FE_DOWNWARD, FE_TONEAREST, FE_TOWARDZERO, FE_UPWARD,

Types:

fenv_t, fexcept_t

Functions:

feclearexcept, fegetenv, fegetexceptflag, fegetround, feholdexcept, feraiseexcept, fesetenv, fesetexceptflag, fesetround, fetestexcept, feupdateenv

40. inttypes.h (C99)

Macros:

PRI{f}{N}, PRI{f}LEAST{N}, PRI{f}FAST{N}, PRI{f}MAX, PRI{f}PTR

SCN{f}{N}, SCN{f}LEAST{N}, SCN{f}FAST{N}, SCN{f}MAX, SCN{f}PTR

where {f} is d, i, o, u, or x (or X for the PRI macros)

and {N} is 8, 16, 32, or 64. See stdint.h

Example:

PRId32, PRIdLEAST32, PRIdFAST32, PRIdMAX, PRIdPTR

SCNd32, SCNdLEAST32, SCNdFAST32, SCNdMAX, SCNdPTR

Type:

imaxdiv_t

Functions:

imaxabs, imaxdiv, strtoimax, strtoumax, wcstoimax, wcstoumax

41. iso646.h (C99)

Macros:

and, and_eq, bitand, bitor, compl, not, not_eq, or, or_eq, xor, xor_eq

42. stdbool.h (C99)

Macros:

__bool_true_false_are_defined, bool, false, true

43. stdint.h (C99)

Macros:

INT{N}_C, UINT{N}_C
INT{N}_MIN, INT{N}_MAX, UINT{N}_MAX
INT_LEAST{N}_MIN, INT_LEAST{N}_MAX, UINT_LEAST{N}_MAX
INT_FAST{N}_MIN, INT_FAST{N}_MAX, UINT_FAST{N}_MAX

where {N} is 8, 16, 32, or 64.

Example:

INT8_C, UINT8_C
INT8_MIN, INT8_MAX, UINT8_MAX
INT_LEAST8_MIN, INT_LEAST8_MAX, UINT_LEAST8_MAX
INT_FAST8_MIN, INT_FAST8_MAX, UINT_FAST8_MAX

INTMAX_C, UINTMAX_C
INTMAX_MIN, INTMAX_MAX, UINTMAX_MAX

INTPTR_MIN, INTPTR_MAX, UINTPTR_MAX

PTRDIFF_MIN, PTRDIFF_MAX

SIG_ATOMIC_MIN, SIG_ATOMIC_MAX

SIZE_MAX

WCHAR_MIN, WCHAR_MAX

WINT_MIN, WINT_MAX

Types:

int{N}_t, uint{N}_t
int_least{N}_t, uint_least{N}_t
int_fast{N}_t, uint_fast{N}_t

Example:

int16_t, uint16_t
int_least16_t, uint_least16_t
int_fast16_t, uint_fast16_t

intmax_t, uintmax_t

intptr_t, uintptr_t


44. tgmath.h (C99)

Includes math.h and complex.h and defines type-generic macros:

acos, acosh, asin, asinh, atan, atan2, atanh, carg, cbrt, ceil, cimag, conj, copysign, cos, cosh, cproj, creal, erf, erfc, exp, exp2, expm1, fabs, fdim, floor, fma, fmax, fmin, fmod, frexp, hypot, ilogb, ldexp, lgamma, llrint, llround, log, log10, log1p, log2, logb, lrint, lround, nearbyint, nextafter, nexttoward, pow, remainder, remquo, rint, round, scalbln, scalbn, sin, sinh, sqrt, tan, tanh, tgamma, trunc


See also en.cppreference.com/w/c/numeric/tgmath

Descriptions: tgmath.h

Lists: C90 math.h, math.h, tgmath.h

comm math_c90.h.list math.h.list > comm_math_c90_c99.txt

comm math_c90.h.list tgmath.h.list > comm_math_c90_tgmath.txt

For comparison: java.lang.Math


45. wchar.h (C99)

Macros:

NULL, WCHAR_MAX, WCHAR_MIN, WEOF

Structure:

struct tm

Types:

mbstate_t, size_t, wchar_t, wint_t

Functions:

btowc, fgetwc, fgetws, fputwc, fputws, fwide, fwprintf, fwscanf, getwc, getwchar, mbrlen, mbrtowc, mbsinit, mbsrtowcs, putwc, putwchar, swprintf, swscanf, ungetwc, vfwprintf, vfwscanf, vswprintf, vswscanf, vwprintf, vwscanf, wcrtomb, wcscat, wcschr, wcscmp, wcscoll, wcscpy, wcscspn, wcsftime, wcslen, wcsncat, wcsncmp, wcsncpy, wcspbrk, wcsrchr, wcsrtombs, wcsspn, wcsstr, wcstod, wcstof, wcstok, wcstol, wcstold, wcstoll, wcstoul, wcstoull, wcsxfrm, wctob, wmemchr, wmemcmp, wmemcpy, wmemmove, wmemset, wprintf, wscanf

46. wctype.h (C99)

Macro:

WEOF

Types:

wctrans_t, wctype_t, wint_t

Functions:

iswalnum, iswalpha, iswblank, iswcntrl, iswctype, iswdigit, iswgraph, iswlower, iswprint, iswpunct, iswspace, iswupper, iswxdigit, towctrans, towlower, towupper, wctrans, wctype

47. stdalign.h (C11)

Macros:

alignas, alignof, __alignas_is_defined, __alignof_is_defined

See also en.cppreference.com/w/c/types


48. stdatomic.h (C11)

For performing atomic operations on data shared between threads.

Macros:

ATOMIC_BOOL_LOCK_FREE, ATOMIC_CHAR_LOCK_FREE, ATOMIC_CHAR16_T_LOCK_FREE, ATOMIC_CHAR32_T_LOCK_FREE, ATOMIC_WCHAR_T_LOCK_FREE, ATOMIC_SHORT_LOCK_FREE, ATOMIC_INT_LOCK_FREE, ATOMIC_LONG_LOCK_FREE, ATOMIC_LLONG_LOCK_FREE, ATOMIC_POINTER_LOCK_FREE, ATOMIC_FLAG_INIT, ATOMIC_VAR_INIT, kill_dependency

Types:

memory_order, atomic_flag, atomic_bool, atomic_char, atomic_schar, atomic_uchar, atomic_short, atomic_ushort, atomic_int, atomic_uint, atomic_long, atomic_ulong, atomic_llong, atomic_ullong, atomic_char16_t, atomic_char32_t, atomic_wchar_t, atomic_int_least8_t, atomic_uint_least8_t, atomic_int_least16_t, atomic_uint_least16_t, atomic_int_least32_t, atomic_uint_least32_t, atomic_int_least64_t, atomic_uint_least64_t, atomic_int_fast8_t, atomic_uint_fast8_t, atomic_int_fast16_t, atomic_uint_fast16_t, atomic_int_fast32_t, atomic_uint_fast32_t, atomic_int_fast64_t, atomic_uint_fast64_t, atomic_intptr_t, atomic_uintptr_t, atomic_size_t, atomic_ptrdiff_t, atomic_intmax_t, atomic_uintmax_t,

Constants:

memory_order_relaxed, memory_order_consume, memory_order_acquire, memory_order_release, memory_order_acq_rel, memory_order_seq_cst

Functions:

atomic_init, atomic_thread_fence, atomic_signal_fence, atomic_is_lock_free, atomic_store, atomic_store_explicit, atomic_load, atomic_load_explicit, atomic_exchange, atomic_exchange_explicit, atomic_compare_exchange_strong, atomic_compare_exchange_strong_explicit, atomic_compare_exchange_weak, atomic_compare_exchange_weak_explicit, atomic_fetch_add, atomic_fetch_add_explicit, atomic_fetch_sub, atomic_fetch_sub_explicit, atomic_fetch_or, atomic_fetch_or_explicit, atomic_fetch_xor, atomic_fetch_xor_explicit, atomic_fetch_and, atomic_fetch_and_explicit, atomic_flag_test_and_set, atomic_flag_test_and_set_explicit, atomic_flag_clear, atomic_flag_clear_explicit

References:

en.cppreference.com/w/c/language/atomic - atomic types

en.cppreference.com/w/c/atomic - Atomic operations library


49. stdnoreturn.h (C11)

Macro:

noreturn
noreturn is a convenience macro which expands to keyword _Noreturn.

See also en.cppreference.com/w/c/language/_Noreturn


50. threads.h (C11)

Macros:

thread_local, ONCE_FLAG_INIT, TSS_DTOR_ITERATIONS

Types:

cnd_t, thrd_t, tss_t, mtx_t, tss_dtor_t, thrd_start_t, once_flag

Constants:

mtx_plain, mtx_recursive, mtx_timed,

thrd_timedout, thrd_success, thrd_busy, thrd_error, thrd_nomem

Functions:

call_once,

cnd_broadcast, cnd_destroy, cnd_init, cnd_signal, cnd_timedwait, cnd_wait,

mtx_destroy, mtx_init, mtx_lock, mtx_timedlock, mtx_trylock, mtx_unlock,

thrd_create, thrd_current, thrd_detach, thrd_equal, thrd_exit, thrd_join, thrd_sleep, thrd_yield,

tss_create, tss_delete, tss_get, tss_set

See also:

en.cppreference.com/w/c/thread

github.com/jtsiomb/c11threads - threads.h implementation using POSIX threads

openmp.org, example - OpenMP is a specification for a set of compiler directives, library routines, and environment variables that can be used to specify high-level parallelism in Fortran and C/C++ programs.


51. uchar.h (C11)

Types:

mbstate_t, size_t, char16_t, char32_t

Functions:

mbrtoc16, c16rtomb, mbrtoc32, c32rtomb