Articles — Page 11

basics of inheritance - part 1

C++ syntax of derivation 1234class base{ //...base class members} 1234class Derived: access-specifier Base{ //...derived class members} the base class is also called the super…

Coding

union & struct & aggregate & constexpr

using aggregate initialization on classes and structs aggregate initialization syntax 1Type objectName = {argument1,...,argumentN} alternatively 1Type objecname…

Coding

union and struct

sizeof() a char* pointer's size is fixed at 4 bytes (on 32-bit system, and double it on 64-bit) and is independent of the volume of data being pointed to. declaring a friend of…

Coding

constructor -3

move constructor 123456789class MyString{ // pick implementation from Listing 9.9};MyString Copy(MyString& source) // function{ MyString copyForReturn(source.GetString())…

Coding

constructor -2

the difference of & used in reference and store address A reference & is a alias of variable and must be initialized before we use it, eg: 1234int a=6;//initialization…

Coding
191011121314