Skip to content
UPEEC

C Language Fundamentals

The building blocks of every C program — standards, tokens, types, expressions and console I/O.

Beginner
Comments 0

Read these in order if you are new to C. Program structure, the compilation process, data types and operators have their own pages earlier in this subject.

Sub-topics (19)

C Language Overview

A small, fast, portable systems language created by Dennis Ritchie at Bell Labs (1972) to write Unix.

Beginner♥ 0🔖 0💬 0

Comments

Notes for humans that the compiler ignores.

Beginner♥ 0🔖 0💬 0

Identifiers

Names for variables, functions and types.

Beginner♥ 0🔖 0💬 0

Keywords

Reserved words with special meaning: `int`, `if`, `return`, `struct`, `static`, `volatile`, …

Beginner♥ 0🔖 0💬 0

Literals

Fixed values written in source: integers, floats, characters and strings.

Beginner♥ 0🔖 0💬 0

Variables

Named storage with a type.

Beginner♥ 0🔖 0💬 0

Constants

Values that should not change: `const` variables, `#define` macros and `enum` constants.

Beginner♥ 0🔖 0💬 0

Type Qualifiers

`const`, `volatile`, `restrict` and `_Atomic` add rules to a type.

Easy♥ 0🔖 0💬 0

Type Conversion

Implicit conversions between types and explicit casts.

Easy♥ 0🔖 0💬 0

Integer Promotions

Types smaller than `int` (char, short, bit-fields) are converted to `int` before arithmetic.

Intermediate♥ 0🔖 0💬 0

Operator Precedence

Which operators bind tighter: `*` before `+`, comparisons before `&&`, assignment last.

Easy♥ 0🔖 0💬 0

Expressions

Combinations of values, variables, operators and calls that produce a value.

Beginner♥ 0🔖 0💬 0

Statements

Instructions: expression statements, blocks `{ }`, selection, loops, jumps and declarations.

Beginner♥ 0🔖 0💬 0

Input and Output in C

Console I/O with the stdio library: formatted (`printf`/`scanf`) and character-by-character.

Beginner♥ 0🔖 0💬 0

printf

Formatted output using conversion specifiers.

Beginner♥ 0🔖 0💬 0

scanf

Formatted input — reads values into variables via pointers.

Easy♥ 0🔖 0💬 0

Character I/O

`getchar`, `putchar`, `getc`, `putc`, `fgetc`, `fputc` read and write single characters.

Beginner♥ 0🔖 0💬 0

Escape Sequences

Backslash codes for special characters: `\n`, `\t`, `\\`, `\"`, `\0`, `\x41`.

Beginner♥ 0🔖 0💬 0

Spotted a mistake or want to add detail? Suggest an improvement — Content Contributors' edits are reviewed by editors before they go live.

Discussion (0)

Sign in or join free to ask questions and discuss this topic.