The Graphics Network

Course Outline - C++ and C

01285 713297 info@tgn.co.uk

C++ has been a powerful workhorse in software development for decades, providing the best possible performance together with object oriented design techniques. While it is still compatible with its original implementations, recent improvements have turned it into a much more powerful and flexible language. The C language it was based on remains popular for developers working 'close to the metal' and it is widely used for everything from Python extensions to operating systems. I've neen coding in and teaching both languages for decades now, and I can train at all levels and for many different environments.

C++

Getting Started
Writing, building and running a C++ Program. Language structure. The main function. Basic stream and console input/output. Declaring and Initializing variables. Fundamental data types. Strings.
Structured Programming
Control flow, loops and conditions. The for loop. do and while. if and else. The conditional expression. Functions and argument passing. Argument passing by value and reference. Predeclarations and prototypes. Using header files. The switch statement. Variable scope - local, static, global. Variable lifetimes. Using namespaces. Memory management. Casting and cast types. Lambdas.
Arrays and Pointers
'C-style' arrays. Array sizes and bounds checking. Multi-dimension arrays. Using pointers. Pointers and new. Dynamic arrays. Pointer arithmetic. Strings.
Object Orientation
What is object orientation? Defining classes and creating objects. Classes vs data structures. Object oriented design concepts.
Using Objects
Encapsulation and data hiding. Constructors and destructors. Default constructors and initialization. Class definition and implementation. Inheritance and polymorphism. Overriding. Constructing applications using objects. Class examples. Practical polymorphism. Virtual functions. Abstract base classes. Run time type information and dynamic_cast. Constant and static members. Using 'this'. Calling the base class constructor explicitly. Friends. Multiple inheritance and virtual base classes.
Dynamic Objects
Pointers and the use of new and delete. Arrays and collections. Safe use of pointers. Pointers and references. Range-based for loop - 'for each'.
Operator Overloading
Defining an operator function. Some rules. Mixing types. Implementing a postfix operator. Type conversion operators. Copy constructors and the assignment operator. Function objects and functors. Indexers.
Streams
The I/O stream library. Inserters and extractors. Error handling. Using exceptions. Using I/O streams with files. Flags and manipulators. Formatting.
Templates
Function templates. Type safety. Using multiple parameter types. Class templates. Using template classes. Using constants.
Smart Pointers
What is a smart pointer?. Smart pointers vs conventional pointers. Shared pointers. Unique pointers. Weak pointers. dynamic_pointer_cast. R-values and move.
The Standard Template Library
Collection classes. Vector. Reserving capacity. Iterators. Using auto for complex types. Stream iterators. Algorithms. Predicates. Using member functions in algorithms. Sorting. Collection types. Sets, maps and find. Threads and multitasking.
Multitasking
Processes and threads. Threads in the standard library. Exploiting threads. Return values and futures. Atomic objects and the atomic template. Synchronization between threads. Mutexes and lock guards. Other synchonization mechanisms. Operating system specifics.
Exception Handling
Overview of exception handling. Using traditional exception handling. Using the Standard Library exception class. Throwing and catching. bad_alloc. Overloading new and delete.
Additional and Historic Features
Structs, unions and typedef. More about main. Logical and bitwise operators. Conditional compilation and the pre-processor. Compatibility with C. More streams. Ancient features you may still meet.

The C Language

Getting Started
Writing, building and running a C Program. Language structure. The main function. Basic console input/output. Declaring and Initializing variables. Fundamental data types. Literal strings.
Control Flow
Control flow, loops and conditions. The for loop. do and while. break and continue. if and else. The conditional expression.
Operators
The basic operators. Shortcuts. Increment and decrement, prefix and postfix. Logical and bitwise operators. Precedence and parentheses.
Functions
Functions and argument passing. Predeclarations and prototypes. Using multiple source files. Using header files. The switch statement. Variable scope - local, static, global. Variable lifetimes. Casting.
Arrays
Defining and using arrays. Array safety. Multi-dimension arrays.
Memory Management and Pointers
Introducing memory management. Using pointers. Pointer manipulation and arithmetic. Arrays and pointers. Arrays and pointers as function arguments. Function pointers.
Strings
Strings and characters in C. Strings as arrays and pointers. Standard string functions. Writing string functions.
Structures and Unions
Data structures. Passing structs by value and pointer. Dynamic structs. Variable length structs. Unions. Nesting and complex structures. Typedef.
Input and Output
Console input and output. Formatting. Dealing with errors. File and device I/O.
The Preprocessor
How the preprocessor works. #define and constants. Conditional compilation. Macros. Passing arguments to macros.