C
The language of embedded systems and operating systems — small, fast and close to the hardware.
C gives you direct control over memory and hardware with very little runtime overhead, which is why it powers microcontroller firmware, operating-system kernels and device drivers.
The price of that power is responsibility: no automatic memory management, no bounds checking, and undefined behaviour if you get things wrong.
Sub-topics (11)
Structure of a C Program
Headers, the main function, statements and return codes — the anatomy of a C program.
C Compilation Process
Source code goes through preprocessing, compilation, assembly and linking to become an executable.
C Data Types and Format Specifiers
int, char, float, double and fixed-width types — and how printf prints them.
Operators in C
Arithmetic, relational, logical, bitwise, assignment and the ternary operator.
Functions in C
Declaring, defining and calling functions in C; prototypes and header files.
Arrays and Strings in C
Fixed-size blocks of elements, and strings as char arrays ending in '\0'.
Pointers
A pointer stores a memory address — the key to arrays, dynamic memory and hardware registers in C.
Dynamic Memory Allocation
Request memory at run time with malloc/calloc/realloc and give it back with free.
Structures and Unions
struct groups related fields; union lets several fields share the same memory.
The C Preprocessor
#include, #define macros and conditional compilation run before the compiler sees your code.
volatile and const in Embedded C
volatile tells the compiler a value can change outside the program's control; const promises it won't be modified.
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.