Advanced C Programming
Duration: 5 days
This course is designed for programmers who need to start writing professional code in C. It is useful to those who have some experience of programming in C already, as well as a conversion course for developers who have considerable experience in programming in other high-level languages.
ANSI Standard C is a general-purpose programming language that is widely used in areas as diverse as operating systems and games. This course will teach you how to write professional ANSI Standard C code, and how to use the functionality provided by the ANSI Standard C library. The course explores concepts and syntax through lectures, discussion and hands-on lab exercises.
Note that the course covers ANSI Standard C and the C Standard Library. It does not cover platform specific topics, and in particular, does not cover the Unix libraries.
The class involves a lot of practical work, so delegates should come along prepared to get coding. The course can be run using either GCC on Linux (or OS X), or Microsoft Visual Studio on Windows.
Course Content
Language Overview
- Data types, variables and operators
- Control flow
- Functions
- Arrays
- Pointers
- Strings
- User-defined types
- I/O
- The preprocessor
- Pointer arithmetic
- Void pointers
- Idiomatic use of pointers
- Pointers-to-pointers
- Arrays and pointers
- Strings and pointers
- Passing arrays to functions
- Dynamic memory allocation
- Using malloc and free
- Command line arguments
- Using typedef with structs
- Pointers and structs
- Self-referential structs
- Bitfields
- Unions
- Opening files
- Reading and writing files
- Binary and text files
- Random access I/O
- Directory operations
- What is in the library?
- String manipulation
- Math functions
- Date and time functions
- Other Standard C functions
- Writing variadic functions
- setjmp/longjmp
- Program layout
- The preprocessor
- Storage classes
- Linkage
- Qualifiers
- Atomic operations
- Alignment
- Sequence points
- Using assert()
- errno
- perror()
- Returning values from programs
- Declaring function pointers
- Using function pointers
- Implementing lookup tables
- Linked lists
- Queues
- Stacks
- Hashing
- Recursive functions
- Binary trees
- Sorting
