Programming in C and C++
Course Structure
There are 12 slots timetabled for this course. The first 9 slots are dedicated to C and the last 3 slots are dedicated to C++.
Slot 1 has a lecture (introduction to C) delivered in LT1. The pre-recorded lectures for slots 2 to 9 should be watched in your own time. The C++ lectures, numbered 10, 11 and 12, will also be given in LT1.
The timetabled slots for sessions 2 to 9 are used for practical lab sessions in the Intel Lab where DJG will be available. Outside of those slots, please consult your supervisor. Each of the eight practical classes has a task to complete, but these are not assessed in any way, so please feel free to collaborate as much as you want, but don't just hand out your own answer.
Practical assessment for this course will be via the formal written Assessed Exercise and subsequent viva voce session. The details will be below. Please ignore any remarks about the Assessed Exercise in the recorded lectures, since these may be out of date.
As stated above, the 8 practical lab sessions are not assessed: it is recommended to attened, but this is in no way compulsorary.
Assessed Exercise (Tick)
There is one Assessed Exercise for this course.
For those called to Viva Voce or seeking assistance where their supervisor cannot help, please follow the viva slot announcements that will be announced in Week 8 of Michaelmas on HELP + VIVA DATES.
Note to supervisors: Compared with last year, nearly everything will be the same. One difference may be an additional non-professionalisim metric, awarded to those who do poor things, such as including many spurious files in their submissions or not being able to name their files correctly (eg repo.zip.zip is often submitted by someone whose operating system hides file names from them).
Submission is via the Moodle page Moodle. The submission deadline is noon on 26th January 2026. The tick will be awarded (at the discretion of the Examiners) even if there are minor errors in the last submission that was made before the deadline.
Worksheet: ProgC-exercise2526.pdf (this is also included in the starter pack).
Your personal starter pack is HERE.
Repeat: For those called to Viva Voce or seeking assistance where their supervisor cannot help, please follow the viva slot announcements that will be announced in Week 8 of Michaelmas on HELP + VIVA DATES.
Clarifications: Q-And-A.
Errata: The C++ slides have been corrected: the example instance of a bicycle on the bottom of slide 38/72
is now well-formed. Also, the template signature on slide 60/72 first bullet point has the corrected array syntax.
Example Sheet: This ProgC Exercise Sheet might prove useful for supervision questions.
There are 8 Lab programming tasks in C and one C/C++ Assessed Exercise
There is no specific task 1, except to gain access to a C compiler and repeat one of the demos from lecture 1. For example
Try also the demo from Concurrent Systems L1: l1-interleaving-demo.zip.
Note that there is a cl-student-ssh server that you could use.
Note: The video and slides for Lecture 4 may mention a previous year's Assessed Exercise (tick). This is not quite the same as this year's tick.
Primary Materials
Supervision Work and Examples Sheet
Lab Programming Tasks and per-lecture tasks and remarks
Session 1
#include <stdio.h>
int main()
{
printf("Hello World!\n");
return 0;
}
Session 2
Session 3
Session 4
Session 5
Session 6
Session 7 (String Matching)
Session 8 (Caches)
Session 9 (Debugging)
Secondary Materials
C: A Reference Manual (Vth ediiton) PDF.
For those with further interest ...
- Systems Design, 12 Lectures to Part Ia (PDF, 96 pages) Note part III of these notes relates to link editing.
- hello-world-in-linux-assembly-language. This provides a concrete example of making a system call.
- Additional lecture video regarding Undefined Behaviour. This video provides coverage of undefined behaviour, going into more detail than required for this course. However, you may find the specific examples interesting. Also, variations of these behaviours are often asked about in examination questions for the Semantics course.
- The Rust language is becomming a realistic replacement for C. Its fierce type system prevents a number of memory management problems that can arise in C and C++. You might like to learn it within the next five years... Torvalds talks Rust in the Linux kernel.
- Further materials might be placed here...
Last year’s course materials are still available.