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
C and C++ have a big overlap in syntax. The standards of C and C++ are also very long, and still in evolution to accept new features. This course will not cover all aspects of C and C++. It is impossible. The course focuses on the most important and unique parts of C and C++. Pointers and memory management will be described and explained almost through all chapters. They make many beginners even experienced developers crazy for bugs difficult to find. But they are important for computing efficiently, and also are the unique advantages of C and C++. Some people hate them, and some love them. We can say pointers and memory management make C and C++ unique to most other advanced programming languages.
The course is designed for undergraduate students who have learnt Java or Python. If the students taking this course have some background knowledge of programming, such as knowing a little Java or Python, it will be helpful. If not, it is also not a problem.
- The first example
- Different programming languages
- Compile and link
- Different errors
- Preprocessor and macros
- Simple input and output
- Command line arguments
- Exercises
- Integer numbers
- Different integer types
- Floating-point numbers
- Constant numbers and constant variables
- Arithmetic operators
- Special notes
if
statement? :
operator- Conditional expressions
while
loopfor
loopgoto
statementswitch
statement
- Arrays
- Strings
- Structures unions and enumerations
typedef
- Pointers
- Pointers and arrays
- Allocate memory in C style
- Allocate memory in C++ style
- Functions
- Function parameters
- References
return
statementinline
function
- Default arguments
- Function overloading
- Function templates
- Function pointers and references
- Recursive functions
- C and C++ with ARM
- Speedup your program
- An example with SIMD and OpenMP
- Avoid memory copy in OpenCV
- Classes and objects
- Constructors and destructors
this
pointerconst
andstatic
members
- Operators in OpenCV
- Operator overloading
- Friend functions
- User defined type conversion
- Increment and decrement operators
- Some default operations
- An example with dynamic memory
- Solution1: Hard copy
- Solution2: Soft copy
- Smart pointers
- Improve your source code
- Derived class
- Access control
- Virtual functions
- Inheritance and dynamic memory allocation
- Examples in opencv
- Class template
- Template non-type parameters
- Class template specialization
std
classes
- Standard output stream and standard error stream
assert
- Exceptions
- More about exceptions
nothrow
- Friend classes
- Nested types
- RTTI and type cast operators
- 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
- Mr. Wenqian Yan's repo for the course in Fall 2022. https://github.com/YanWQ-monad/SUSTech_CS205_Projects