Class and Object-tccicomputercoaching.com

Page 1

Class and Object-tccicomputercoaching.com Class is a user defined data type, which holds its own data members and member functions, which can be accessed and used by creating an instance of that class. A class is like a blueprint for an object.

The data and functions within a class are called members of the class. For example, class student { int rn; float per; void print() { cout<<"The per of rn "<<rn<<"is"<<per; } }; void main() { student s; s.rn=10; s.per=76.8; s.print();


Turn static files into dynamic content formats.

Create a flipbook
Issuu converts static files into: digital portfolios, online yearbooks, online catalogs, digital photo albums and more. Sign up and create your flipbook.
Class and Object-tccicomputercoaching.com by Rosario Riley - Issuu