Computer Laboratory

Course pages 2017–18

Programming in C

Principal lecturer: Dr Neel Krishnaswami
Taken by: Part IB CST 50%, Part IB CST 75%
Past exam questions

No. of lectures: 10
Suggested hours of supervisions: 3
Prerequisite courses: None, though Operating Systems would be helpful.

Aims

The aims of this course are to provide a solid introduction to programming in C and to provide an overview of the principles and constraints that affect the way in which the C programming language has been designed and is used.

Lectures

  • Introduction to the C language. Background and goals of C. Types and variables. Expressions and statements. Functions. Multiple compilation units. [1 lecture]

  • Further C concepts. Preprocessor. Pointers and pointer arithmetic. Data structures. Dynamic memory management. Examples. [2 lectures]

  • Linkers and loaders. Executable sections. Debug symbols. Inspecting program state. [1 lecture]

  • C semantics. Undefined vs implementation-defined behaviour. Common optimisation problems. Buffer and integer overflows. Examples. [1 lecture]

Objectives

At the end of the course students should

  • be able to read and write C programs;

  • understand the interaction between C programs and the host operating system;

  • be familiar with the structure of C program execution in machine memory;

  • understand the potential dangers of writing programs in C.

Recommended reading

* Kernighan, B.W. & Ritchie, D.M. (1988). The C programming language. Prentice Hall (2nd ed.).