AI, Data Science & Cloud Certificates from Google, IBM & Meta
Get 20% off all career paths from fullstack to AI
Overview
AI, Data Science & Cloud Certificates from Google, IBM & Meta — 40% Off
One plan covers every Professional Certificate on Coursera. 40% off Coursera Plus Annual.
Unlock All Certificates
Learn to build a custom string class in C++ by implementing your own version of std::string from scratch. Master dynamic memory management, the Rule of 3/5, and essential string operations through hands-on coding. Explore class structure design, default and parameterized constructors, deep copy mechanisms, and destructor implementation. Implement the copy-and-swap idiom for safe copy assignment, along with move constructor and move assignment for efficient resource management. Add core functionality including length() method, c_str() access, substr() for string extraction, operator[] for indexing, and equality/inequality comparison operators. Follow modern C++ practices while understanding the internal workings of string classes, memory allocation strategies, and performance optimization techniques that make std::string so effective in real-world applications.
Syllabus
00:00 – Introduction
01:38 – Class structure
02:00 – Default Constructor
02:16 – Parameter Constructor
04:15 – Move Constructor
04:40 – Move Assignment
Taught by
CppNuts