C++ emerged from Bell Labs in 1979, developed by Bjarne Stroustrup as an extension of the C language, incorporating object-oriented principles. It is characterized by high performance, low-level control, and object-oriented features. The evolution of C++ reached a significant milestone with the rele...
Introduction Hello everyone, this is Xiamu's C++ study note. Here, I will explain the vector container from the C++ STL. This blog is suitable for those who are learning vector or want to deepen their understanding of STL. We will not only introduce the various features of vector but also implement...
Quest Data Structure The core quest structure defines mission parameters including objectives, rewards, and completion conditions: USTRUCT(BlueprintType) struct FQuest { GENERATED_BODY() UPROPERTY(EditAnywhere, BlueprintReadWrite, Category = "Task") FString QuestName{ "Empty" };...
Development Environment and Project Configuration When managing multiple source files within a single C++ project using CMake, you can automate the generation of executables for each .cpp file found in the source directory. This is particularly useful for competitive programming or educational modul...
Creating Dynamic Libraries Windows DLL Development To create a Windows dynamic link library, start by establishing a DLL project. The core functionality is implemented in the source file: #include "framework.h" extern "C" __declspec(dllexport) int addValues(int x, int y) { return...
Palindrome Date Calculation The code below checks for palindrome dates between two given date strings. #include<iostream> #include<cstring> #include<sstream> using namespace std; string data1; string data2; int cnt; int y1,m1,d1; int y2,m2,d2; int day[] = {31,28,31,30,31,30,31,31,3...
Program Memory Layout During execution, a C++ program partitions memory into four distinct regions, each governing the lifecycle of stored data. Code Region: Holds binary machine instructions, managed by the operating system. Global Region: Stores global variables, static variables, and constants. S...
Overview Inheritance is one of the core principles of object-oriented programming, enabling the creation of new classes based on existing ones. This mechanism allows for code reuse at the class level, making it a fundamental concept in C++. Concept and Definition Concept Inheritance enables extendin...
The Simple Factory pattern centralizes object instantiation behind a unified interface, adhering strictly to the Dependency Inversion Principle. High-level modules interact exclusively with abstractions rather than concrete implementations, decoupling client logic from construction details. 1. Abstr...
After covering destructors in a previous note, this antry continues with two essential default member functions: copy constructors and operator overloading. Copy Constructor A copy constructor is a special constructor whose first parameter is a reference to the same class type, and any additional pa...