
From Programming in C++
C-style string is a char array ending with '\0' and often uses <cstring> functions like strlen.
std::string is a C++ class that manages memory automatically and supports easy operations like concatenation and length using methods.
C-style strings need careful size handling; std::string is safer.
Early binding is compile-time function selection (non-virtual). Late binding is run-time selection (virtual). Late binding chooses function based on actual object type through base pointer/reference.
Get instant access to notes, practice questions, and more benefits with our mobile app.
A constructor is a special member function that initializes an object.
Properties:
Types:
ClassName(const ClassName &obj))Create object → matching constructor runs → object becomes ready to use
So constructors ensure objects start in a valid and usable state.