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

Popular posts from this blog

c# - DetailsView in ASP.Net - How to add another column on the side/add a control in each row? -

javascript - firefox memory leak -

Trying to import CSV file to a SQL Server database using asp.net and c# - can't find what I'm missing -