Lab 06 -- C Programming, Arrays, Strings and Pointers
This page gives an overview of the lecture and the lab session on Sep 04, 2025.
Short lecture summary
-
Arrays - declaration, usage and examples.
sizeof
operator andsize_t
type. No check for array bounds in C. -
Pointers in C. Reason behind the use of
&
operator inscanf
function. Referencing and de-referencing. Use of pointers via examples. -
Dangers associated with pointer and array use. Strings in C as array of characters and the null character
\0
. -
Multi-dimensional arrays. Simple examples. Row and column major form of representation in memory.
Readings
-
Notes on C programming by Jasine.
These notes are based on the lectures for the course CS1100 Introduction to Programming (Aug-Dec 2016) offered at IIT Palakkad. You can find a link to the complete set of notes here.
Read Lectures
-
C Programming A Modern Approach (2nd Ed) by K. N. King (Online version)
Read chapters
Practise
-
Practise all interactive exercises from Chapter 2 of Dive into Systems
-
Exercises on C pointers.
-
Puzzles on C programming. Work out Part 1D, 2D, P and Part S from this link.
Additional readings
-
Arrays and pointers from Essential C.
-
Notes by Dave Marshall on pointers and how to use them.
-
Notes on Programming in C. Check the section on pointers.
-
Chapter 2 - Representing and Manipulating Information from Computer Systems: A Programmer’s Perspective, third edition