CPP

Articles carrying this tag.

c++ debug notes

Link Against the GSL Libraries When we compile code with GSL, we need to tell the linker to include the GSL libraries. For example, modify our compile command from 1g++ -o…

Coding

casting operators

the c++ casting operators the four c++ casting operators are static_cast dynamic_cast reinterpret_cast const_cast use static_cast static_cast is a mechanism that can be used to…

Coding

operator type and overloading -part III

move constructor and move assignment operator Take a look at the addition operator + as implemented in demolist12_4. Notice that it actually creates a copy and returns it. While…

Coding

operator type and overloading -part II

binary operators operators that function on two operands are called binary operators. syntax : 1return_type operator_type (parameter1, parameter2); when it implement as a class…

Coding

operator type and overloading -part I

on a board level, operators in c++ can be classified into two type: unary operators and binary operators. unary operators operators that function on a single operand are called…

Coding

polymorphism -3

specifier override to indicate intention to override Assume that you want override the Fish::Swim in Derived class but with a slightly different signature - one using const…

Coding

polymorphism -2

using virtual inheritance to solve the diamond problem how many instances of Base class are instantiated for one instance of secDerived which is derived from Derived class when…

Coding

polymorphism -1

basics of polymorphism e.g. invoking methods using an instance of Base class which belongs to Derived class. demolist11_1…

Coding

implementing Inheritance - Q&A

Q&A Q : class D2 inherits from class D1, which inherits from class Base. To keep D2 from accessing the public members in Base, what access specifier would you use and where…

Coding

Inheritance

private inheritance private is used in the line where the derived class declares its inheritance from a base class. syntax 123456789class Base{ //...base class members and…

Coding
123