Skip to main content

C notes

References

Pre-standard C

  • K&R (1978) B. W. Kernighan & D. M. Ritchie. The C Programming Language.

C89

  • K&R, 2e (1988)

C99

  • P. J. Plauger. The Standard C Library.

C11

The standard library

ctype.h

Only for unsigned chars (converted to int) and EOF.

  • Predicates:
    • iscntrl and isprint are complementary.
    • ' 'isblankisspace.
    • isprint = isgraph + ' '.
    • isgraph = ispunct + isalnum.
    • isalnum = isalpha + isdigit.
    • isalpha = isupper + islower.
    • isxdigit.
  • Convertors:
    • toupper, tolower.

locale.h

‘The simplest way to use locales is to ignore them. Every standard C program starts up in the "C" locale.’

[Plauger, p. 88]