1. Down git-lfs [link](https://git-lfs.com/) 2. In command line 3. Tracking file type 4. Add gitattribute file 5. push
How and Why to use dynamic_cast in C++?
When you assign an object of a derived class to an object of a base class, the derived class portion of the object gets sliced off. So if you simply try to call the employee base class operator= function to copy the entire employee portion of the object, the derived class portion will be lost. …
Keyword “const” in C++
When declaring a member function as const, it means that the function is not allowed to modify the object on which it is called. This allows you to call the function on a const object, ensuring that the object’s state is not changed. In the case of the getFirstName() member function in the example I …
“A:class type redefinition” error in C++
The error “class type redefinition” typically means that you have multiple definitions of the same class in your code, which can cause conflicts and errors. This error can occur if you have included the header file for class A in both A.cpp and B.cpp, or if you have included it multiple times in B.cpp. When …
How to declare and initialize a static variable in C++?
A static value is associated with the class rather than individual objects. In C++, the static data members are declared inside the class definition but defined outside the class definition. When you declare a static variable in the header file, it creates a declaration of the variable in every file that includes the header. And …
Continue reading “How to declare and initialize a static variable in C++?”
Constructor with char* in C++
How to use _CRT_SECURE_NO_WARNINGS
Add define before the first line #include