Programming in C
“Master pointer arithmetic, recursion tree tracing, array-decay rules, structure padding, preprocessor macros, and storage classes.”
A rigorous, mathematically precise study notebook covering the internal semantics, low-level memory layouts, and compilation mechanics of C: operator precedence, right-to-left associativity, short-circuit evaluation, storage classes (auto, static, extern, register), pointer arithmetic, array decay, multi-dimensional row-major mapping, double pointers, function pointers, activation records, stack frames, recursion tracing, structure padding and alignment, unions and bit-fields, dynamic memory management (malloc, calloc, realloc, free), preprocessor macro expansion, and formatted file I/O for undergraduate excellence and top-rank GATE CS/IT performance.
Structured Notes & Exam Lens
A · B.Tech Structured Study Sequence
5 Sections · Full CurriculumOperator Precedence, Short-Circuit & Storage Classes
C operator hierarchy, right-to-left associativity rules, short-circuit evaluation, sequence points, auto/static/extern/register storage classes, and lexical scoping.
Prefix vs postfix increments, bitwise vs logical operators, and short-circuit traps.
auto, register, static, and extern lifetime, memory segments, and linkage rules.
Pointers, Array Decay & Function Pointers
Pointer arithmetic scaling, array decay, multi-dimensional array row-major offsets, double pointers, and function pointers.
p + 1 scales by sizeof(*p), *(A + i) vs A[i], and 2D matrix row-major offsets.
Function pointer syntax int (*fp)(int), callbacks, and mutable char[] vs immutable char*.
Functions, Recursion & The Call Stack
Function call frames, activation records, static variable retention across recursive calls, tail recursion, and tree recursion call tracing.
Stack frames, activation trees, and static variable state accumulation.
Call-by-value semantics, simulating call-by-reference via pointers, and tail call elimination.
Structures, Unions & Memory Alignment
Structure memory alignment, padding bytes, member reordering, unions, bit-fields, and dynamic memory allocation (malloc, calloc, realloc, free).
Natural word alignment, member reordering optimization, and heap management.
Union memory overlap, bitfield packing, malloc, calloc, realloc, and free.
Preprocessor Directives, Macros & File I/O
Macro text substitution, argument side effects, stringification (#), token concatenation (##), printf/scanf return values, and file streams.
Macro text substitution, # and ## operators, and macro argument side-effect hazards.
printf/scanf return values, format specifiers, and FILE* buffered file handling.
B · GATE 2027 Syllabus Scope
Official syllabus scope and related lesson coverage; topics outside the syllabus are marked as enrichment.
- •Programming in C: Functions, recursion, parameter passing, scope, binding, storage classes
- •Pointers and arrays: Pointer arithmetic, multi-dimensional array mapping, array decay, function pointers
- •Structures and unions: Memory alignment, structure padding, bit-fields, dynamic memory allocation (malloc, calloc, realloc, free)
- •Preprocessor directives, operator precedence, associativity, sequence points, formatted I/O
Interactive Labs & Verified PYQs
Revision & Rapid Review Sheets
Authoritative Textbooks & Video Lectures
All notes in this notebook cross-reference standard academic literature. We do not pretend student notes substitute for classical texts — they guide you through them.
Curated lectures from verified educators (Gate Smashers, Neso Academy, Knowledge Gate, and MIT OCW) selected specifically for difficult concept visualizations.
These notes are open and maintained together.
Found a factual mistake? Have a clearer explanation or mental model? Created a useful diagram or worked out a tricky GATE question? Help make this notebook better for every student who opens it next.