Notes and Talks/UJEP/UPC/01

The C Programming Language

Year Standards
1978 K&R book, 1st ed.
1983 ANSI C, K&R 2nd ed.
โ€ฆ โ€ฆ
2011 C11
2018 C17
2024C23

The K&R book ("The C book")

A book on C programming, written by Brian Kernighan๐ŸŒ and Dennis Ritchie.

It is a classic.

The program structure

Data types

fundamental:

derived:

special:

Operations

over fundamental data types

over derived data types

Expressions

Statements

Statements can be:

Expressions are statements, but not all statements are expressions:

Functions

Declarations are optional.

Other features

All additional features: input/output, memory management, multithreading โ€ฆ must be implemented in a library. Standard libraries:

Program

Two kinds of source files:

Preprocessor and macros

Preprocessor is one of the most powerful features of C. It is purely textual, runs before the compiler and handles directives, macros, and conditional compilation.

Hello, World!

Hello, World! is the first program that is traditionally used as an introduction to a programming language. It prints "Hello, World!" to the console.

It is a kind of a tradition started by Brian Kernighan.

See

  1. docker

  2. hello