Skip to content
/ CPP Public
forked from ShiqiYu/CPP

Lecture notes, projects and other materials for Course 'CS205 C/C++ Program Design' at Southern University of Science and Technology.

License

Notifications You must be signed in to change notification settings

csydlut/CPP

 
 

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

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 11: Dynamic Memory Management in Classes

Some Default Operations

  • Default constructor
  • Copy constructor
  • Assign operator
  • Default destructor
  • How pointer members work by default

An Example with Dynamic Data Allocation

Solution

Matrix Data Management in OpenCV

Lab

Create a class for matrices which elements are in float. The class should support the follow operations and has no memory management problem. When a matrix is assigned to another by =, the two matrices will share the same data. class Matrix{...}; Matrix a(3,4); Matrix b(3,4); Matrix c = a + b; Matrix d = a * 2.0f;

Chapter 12: Class Inheritance

Deriving a Class

  • Constructor
  • Destructor

Static and Dynamic Binding

Vitural Functions

Access Control (protected)

Dynamic Memory Management

Lab

Chapter 13: Class Templates and std Library

Defining a Class Template

Templates in OpenCV

Templates in std

Lab

Create a matrix template class which can handle different data types.

Chapter 14: Exceptions

Chapter 15: Friend Classes and Nested Classes

Reference

  1. Mr. Yitong Wang's repo for the course in Fall 2020. https://github.com/YeeTone/CS205-2020Fall

About

Lecture notes, projects and other materials for Course 'CS205 C/C++ Program Design' at Southern University of Science and Technology.

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages

  • C++ 96.5%
  • C 1.8%
  • CMake 1.7%