Programming in C/C++ Efficiently
Course 'CS205 C/C++ Program Design' in 2021 Fall at Southern University of Science and Technology. The lecture videos can be found at https://www.bilibili.com/video/BV1Vf4y1P7pq
Chapter 1: Getting Started
- The first example
- Different programming languages
- Compile and link
- Preprocessor and macros
- Simple input and output
Chapter 2: Data Types and Arithmetic Operators
- Integer numbers
- More integer types
- Floating point numbers
- Arithmetic operators
Chapter 3: Loops and Branching Statements
if
statement- Conditions
while
loopfor
loopgoto
switch
Chapter 4: Data Structures
- Arrays
- Strings
- Structures unions and enumerations
typedef
Chapter 5: Memory and Pointer
- Pointers
- Pointers and arrays
- Allocate memory in C style
- Allocate memory in C++ style
Chapter 6: Basics of Functions
- Functions
- Function parameters
- References
return
statementinline
function
Chapter 7: Advances in Functions
- Default arguments
- Function overloading
- Function templates
- Function pointers and references
- Recursive functions
Chapter 8: Speedup Your Program
- C and C++ with ARM
- Speedup your program
- An example with SIMD and OpenMP
- Avoid memory copy in OpenCV
Chapter 9: Basics of Classes
- Classes and objects
- Constructors and destructors
this
pointerconst
andstatic
members
Chapter 10: Advances in Classes
- Operators in OpenCV
- Operator overloading
- Friend functions
- User defined type conversion
- Increment and decrement operators
Chapter 11: Dynamic Memory Management in Classes
- Some default operations
- An example with dynamic memory
- Solution1: Hard copy
- Solution2: Soft copy
- Smart pointers
Chapter 12: Class Inheritance
- Improve your source code
- Derived class
- Access control
- Virtual functions
- Inheritance and dynamic memory allocation
- Examples in opencv
Chapter 13: Class Templates and std Library
- Class template
- Template non-type parameters
- Class template specialization
std
classes
Chapter 14: Error Handling
- Standard output stream and standard error stream
assert
- Exceptions
- More about exceptions
nothrow
Chapter 15: Nested Classes and RTTI
- Friend classes
- Nested types
- RTTI and type cast operators
Reference
- Mr. Yitong Wang's repo for the course in Fall 2020. https://github.com/YeeTone/CS205-2020Fall
- Mr. Zheng Dong's repo for the course in Fall 2021. https://github.com/XDZhelheim/CS205_C_CPP_Lab