0

What are data members and member function

3rd Feb 2020, 3:46 PM
Soham
4 Answers
+ 5
Variables declared within a class preceded by a data type which define the state of an object are called data members, and functions which define the behaviour of an object of that class are called member functions. Eg- class human{ private: string name; // data member int age; // data member public: void run(){ }; // member function void eat(){ }; // member function };
3rd Feb 2020, 4:11 PM
Avinesh
Avinesh - avatar
0
Thank you
3rd Feb 2020, 4:21 PM
Soham
0
thanks
30th Apr 2021, 5:49 PM
sudip modi 168
sudip modi 168 - avatar
0
Super explain ☘
5th Jul 2022, 10:53 AM
Sahil Jadhav