explicit call of constructor in c++

preview_player
Показать описание
In this video you will learn that how to call a constructor explicitly.

Calling Constructor in c++
• C++ allows us to call constructor in two ways.
o Implicit call : In implicit call the constructor is automatically called when we declare the object.
o Explicit call : In explicit call the constructor is called like a normal function. Generally explicit call appears on the RHS of assignment and on LHS of assignment there is object of the class.
• In all earlier videos we have used the implicit call of the constructor.
• We use following syntax in explicit call of constructor:
Classname objectname=ClassName();
• If the constructor takes parameters then we have to pass arguments for them in explicit call.
Рекомендации по теме
Комментарии
Автор

Thank you so much.
This indeed helped

devduttsharma
join shbcf.ru