c++ - Pointers and Polymorphism -
this question has answer here:
i have problems understanding following c++ code. can please explain me meaning of line 3? ": lmp(ptr)" before constructer mean?
i cannot make sense out of it
class pointers { public: pointers(type* ptr) : lmp(ptr) {} virtual ~pointers() {} protected: type* lmp; }; }
: lmp(ptr)
is called constructor initialization list
. initialize lmp
ptr
. see link understanding: what constructor initialization list , why should use it
Comments
Post a Comment