Lab 05 -- C Programming, Compiling, C Syntax and Semantics
This page gives an overview of the lecture and the lab session on Aug 28, 2025.
Short lecture summary
-
Compilers. Stages involved - preprocessor, compilation, linking, loading.
-
Need for libraries. How compilation and operating systems are related to libraries.
-
Variable types, initalization and declaration of variables, signed versus unsigned. Logical, assignment operations. Bitwise operation support. Repetitions. Using printf and scanf and their usage. All of these illustrated by comparision with analogous python programs.
Readings
-
Dive Into Systems by Suzanne J. Matthews, Tia Newhall, Kevin C. Webb (Online version)
Read chapters
-
C Programming A Modern Approach (2nd Ed) by K. N. King (Online version)
Read chapters
Practise
-
For an excellent and visual way to learn C programming, check the python tutor page for C here created by Philip Guo. Type out some programs, compile and see how it runs all without leaving your browser. Also a nice article tracing its history.
-
Puzzles on C programming. Work out Part E and Part L from this link.
Additional readings
-
Read on the coding style for C programming used in the Linux kernel.
-
FAQs on C programming - an excellent source of reference on popular usages of C constructs.
-
Notes on Programming in C. Check the sections on Compiling, linking and loading and Preprocessor.
-
For a quick review of almost all C features, you can check here.
-
Chapter 2 - Representing and Manipulating Information from Computer Systems: A Programmer’s Perspective, third edition