Principles of C and Memory Management


  1. To introduce the issues of memory and memory management within the context of a system-level procedural programming language (C), and debugging tools that facilitate the inspection of state, stack and heap usage during code execution.
  2. To familiarise students with a contemporary system-level procedural programming language (C).
  3. To demonstrate principles, provide indicative examples, develop problem-solving abilities and provide students with experience and confidence in the use of algorithms with consideration and management of memory usage within a contemporary software setting.


  • Walkthrough of various elements of the C programming language, by example. (4 lectures, 4 labs)
  • Exploration of the use of heap-based memory in C through the use of arrays, pointers, and strings, and exploring their representation in memory using a debugger. (2 lectures, 2 labs)
  • Dynamic data structures in C: structs and the dynamic creation and distruction of structs. (2 lectures, 2 labs)
  • Advanced issues, including function pointers and the C pre-processor. (2 lectures, 2 labs)

Recommended Texts

Brian W. Kernighan and Dennis M.Ritchie: The C Programming Language. Prentice Hall (most recent edition)

Learning Outcomes

At the end of the module the student should be able to:

  1. analyse and explain the use of memory resources within software applications, including memory usage on the stack during function calls and heap-based dynamic memory management;
  2. use debugging tools to inspect memory usage, and to assist in the development of software;
  3. develop applications within the C programming language, including use of command-line driven C development tools.
  4. deal with underlying memory-based issues in using dynamic data-structures through the inplementation and management of at least one familiar datastructure using the C programming language.

Learning Strategy

Formal Lectures: Students will be expected to attend two hours of formal lectures per week over 5 weeks. Formal lectures will be used to introduce students to the concepts and methods covered by the module.

Practicals: Students will be expected to attend two hour of computer lab practicals per week over 5 weeks. Computer lab practicals are intended to allow students to undertake practical exercises with the possibility of immediate feedback. The lab exercises will focus on the design and implementation of applications that exploit and utilise the approaches discussed in the lectures.

Private study: In a typical week students will be expected to devote about 9 hours of unsupervised time to private study over a period of 6 weeks. Private study will provide time for reflection and consideration of lecture material, background reading and completion of the assessment tasks.

Assessment: The module will be 100% continually assessed, which will take the form of programming assignments, which will necessitate the development of novel solutions that are language specific and address the learning outcomes of the module.