Practical Programming in C

Course Description

This course provides a thorough introduction to the C programming language, the workhorse of the UNIX operating system and lingua franca of embedded processors and micro-controllers. The first two weeks will cover basic syntax and grammar, and expose students to practical programming techniques. The remaining lectures will focus on more advanced concepts, such as dynamic memory allocation, concurrency and synchronization, UNIX signals and process control, library development and usage. Daily programming assignments and weekly laboratory exercises are required. Knowledge of C is highly marketable for summer internships, UROPs, and full-time positions in software and embedded systems development.

Lecture Notes

The actual size of these slides is 12.8 cm by 9.6 cm. Use Adobe Reader's print options to scale the slide to fit the page before printing.
LEC #
TOPICS
LECTURE NOTES
1
Introduction. Writing, compiling, and debugging C programs. Hello world.
(PDF)
2
Variables and datatypes, operators.
(PDF)
3
Control flow. Functions and modular programming. Variable scope. Static and global variables.
(PDF)
4
More control flow. Input and output.
(PDF)
5
Pointers and memory addressing. Arrays and pointer arithmetic. Strings. Searching and sorting algorithms.
(PDF)
6
User-defined datatypes, structs, unions, bitfields. Memory allocation. Linked lists, binary trees.
(PDF)
7
Pointers to pointers, pointer and string arrays, multidimensional arrays. Stacks and queues.
(PDF)
8
Void and function pointers. Hash tables.
(PDF)
9
External libraries. B-trees, priority queues.
(PDF)
10
C standard library: stdio.h, ctype.h, stdlib.h, assert.h, stdarg.h, time.h
(PDF)
11
Dynamic memory allocation, malloc and valgrind, garbage collection.
(PDF)
12
Multithreading and concurrency.
(PDF)
13
Multithreaded programming. Sockets and asynchronous I/O.
(PDF)
14
Linux inter process communication.
(PDF)

Assignments

Special software is required to use some of the files in this section: .zip, .c, and .db.

NO.
TOPICS
ASSIGNMENTS
SOLUTIONS
1
Writing, compiling, and debugging programs; preprocessor macros; C file structure; variables; functions and problem statements; returning from functions
(PDF)
(PDF)
2
Types, operators, expressions
(PDF)
(PDF)
3
Control flow, functions, variable scope, static and global variables, I/O: printf and scanf, file I/O, character arrays, error handling, labels and goto
(PDF)
(ZIP) (This ZIP file contains: 1 .txt file and 2 .c files.)
(PDF)
4
Pointers, arrays, strings, searching and sorting algorithms
(PDF)
(PDF)
5
Linked lists, trees
(PDF)
(PDF)
6a
Pointers to pointers, multidimensional arrays, stacks and queues
(PDF)
(ZIP) (This ZIP file contains: 1 .txt file and 2 .c files.)
(PDF)
6b
Function pointers, hash table
(PDF)
(ZIP) (This ZIP file contains: 1 .txt file and 2 .c files.)
(PDF)
7
Using and creating libraries, B-trees and priority queues
(PDF)
(ZIP) (This ZIP file contains: 2 .c files and 1 .db file.)
(ZIP) (This ZIP file contains: 5 .txt files and 5 .c files.)

No comments: