OOP Basic--what's the diff between struct & class?
Q:
if struct can have the construtor/desctructor and memeber functions ? if so, what's the diff between struct& class?
A:
Yes! and the diff is that: in Class ,the default variables access type is priavate, while public in struct. struct can also have constructor/destructor and can be inherited from base class also,etc.
if struct can have the construtor/desctructor and memeber functions ? if so, what's the diff between struct& class?
A:
Yes! and the diff is that: in Class ,the default variables access type is priavate, while public in struct. struct can also have constructor/destructor and can be inherited from base class also,etc.