We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PDF or read online on Scribd
You are on page 1/ 8
B.CA, Part -I New CBCS Pattern (Semester:
Course Code: CC 203
Course Title: Object Oriented Programming Using C++
Unit - 2 OBJECT, CLASSES & CONSTRUCTOR
new user defined data type
member
Scan bedfined by using a
has its body, cota
wate: // Data Members
‘Member Functions
1/ Member Functions
’
‘The private members dita
data and prea anctens cannot
ose are defined atthe begining ofthe class body with
{as private members by default. Each access specifiers le. private,
ced follows single colon (
Int emp. code;
sharemp.name{i0}:
public
void getdata
wold display
Prof.Annasaheb M.Chougule [MMM]
ae
e
Here the dass employee contains two data members and two member fnclone a
‘espectvely. The data members Le emp coe and
were as both the member functions are public by specieaaon
sed 108d valu from the se
les of data members. The data members ofthe employe dl
functions of the clase employee,
lay) us sed to display the
accessible the member
‘+ Arguments toa Function -
ta function copes the actual uPe Sh Agument
ngs made othe para naet
out <<"ARer swap vale of <<< end
)
output:
Before swap valu of :100
Before swap vale ofb:200
Aft swap, value af :200,‘Aer srap vue fy 100,
Calbyreferencein co+
Example:
fale ostream b>
Usngrmamespacest
Before swap, valve ofa" >ampcadssen ame
yee code:="ccamp. code
ployename=">emp. 236,