OBECT ORIENTED PROORIMHING mob 0410
(using ert)
ogrtamming ¢-
J wroting o progican
> eng Preogxarn
y exeu ra preogrtany
hte cycle xt Progra
Tye t Peogtasrning $7
4. Monolithic
d. Strencducread a. C, BAEIC
3 procedurcal ey, COBAL » DBQ -
A. QO? ct , Tova, malta, pythoy
sec ures .
Monolithic i
>» Mono Lthic
Single Labbe, suet
> Enhiee ok oh inghtuchion arte taken os
Cinghe Lontk
#4, Matlin Language
Accambly Longuicas
uct ucad 5
rn pagal fe embedded cfsn ox
preededinod HrenelineeProcedural $=
y he pringeaim te Diutded tude trnablose .
cwb ~preogscams / puocediuees colic .
can be exrceuted cimultanzously 1
make Re progam taster.
OOP t-
7 object oretented PrLogat orang
6n prtocedurtal Prtaghtcumnming ophartl
zach petoceduce con have Ue Own
local Aaka on Varciable , Hence Mere
is 90 grablirn af edeurely
joteoducllon to Ctt pi 04-04-28
eye ey CH Ctl
fohon Cth % BARN chor up
2 [sgt] Gsnntly Language)
nS
\¢ bared
q
ne
[ae ae
A we
[ e it | (Rick Maserttt )Operators in CH te
a. Aree R mactte
a. Condrtioual
3 Relational ; tn)
i — timple =
x. “Assignment Cahonk howd Ge, 726 to? =)
6. Trewcemeut / Decrtement-
&:
Bitetse sluts
Ht. Shreecem opert adore
rp “ik >
Cextrenchion’ Can verfioy /
ines whion ) extraction)
Keytoord ee
Ba kg Chavo me
44 Kaur in C44
Angub vulpct slatemeds
4, couk v urs inttand vf pret C)
Ul esl ages inckoad oP seond ()
Couk s—
+ ved, to Aicplay reer ltt Artom memory -
> precdlePined object of ornoam chars
big
> wel to accept docia fron tater and
Chore Ta mamores
2 predofiaccl object “oP vedieoam cLout .pranld oe atane() - dounaded howcerker rT
foul, bin oe
couf S Cin inte. undowmated, choracker
oudput (ee) ose
(gsheerarn)—— —> cache mernory
(Memon
cout, rs
hock” ine j fc + |
1) i —
Pom Wy Freon) ©
£ esenk {0
Ringo 46,
ehiceam ) “EEC:
Qheram o- conten sf bik Camo
art of cache memouy )
\
i
amo? cureoa af mnemory- U4
Aor -temporaty pert allio9
(= aa
Liq
(Mune) (teu 7
i FF
>? 0) >> ‘
dela doe (ct) isedt aks
in puk SAeaaro : aN
and ingore 10 =
masonry
dsodedile §— Liogleeam » hy=
Coul s~
Cou << 4 icing "oe yorunbl <4 eae
ta o : "
ype SUE ue \o pranks £ (“our raga, a a
cout
>
a. Seonh (" d7d’, 2,26) 5
cin >> a»>b;
Tunbo Crt! (add. cpp)
seinclude Liostroan + hy
sas Leone: ny
vol Mee)
:
end O ,bC 5
coud dc "enber 4 nos’ 5
Cin >> a>>bS
C= ath;
Couk <4" Sur wh gc es
get 0) 5
t
Dav ett
ae namespace atd 5
PH include < fo ¢itoam >
fd may 0)
fTntrtodudion fo OOP 8 Sale
> THe data Cvariabtis) ond code (funebions)
art claken a¢ a Ci gle une called
Obj eck -
Pillans of oP one
> Hotreaction
~ Fnoapeulation
> Loherertarn ee
> Polymarephienn
Conupts and Aaadueer_in Oo? -
dy Abeficaction
Q. Clase
3. Eneapeulad toy
4. Object
5+ Tnhows tance
6. Mus Pascin
+> PoLyrnoreplrer
oF pelajation /candainsrship
F Dada Hiding .
Data Abohaction + -
Coumn areice )
? Extreaching eacontial Forties ug tthout
gen -to backsnoundl deta -
NMlecebed to memory> So Preanosnneng Aad a ah ohacion reef ores
to incompule MH LIVOK alloratioy c be
duran “memoey clorabtey to an ject
Abe vorciabler ore not allocated ane
he unedion “arte alloy sled » OAH lolal
unit Whe memortty slfocafion v4 incomplete
hie preocest af paretial momorey oll onion
ie called dada abstieaelion i ee
ee ee
Lose 3~ - .
> collection af Varceable Cclaba) anel fuencfiout
Leo). ‘ ae
~ Collection at dientlan ~lupe af “Binge (objec)
27." Floto” = gael lowar’ 1s an abject -
~ Duretng rm amore oMocadion fnstially Wu
in cttons “ture allocated but the .
voriabis cre not dblocated -Hente Re
memory allocation preoeese 8 taco meplete
and called as ata obedicaction
» docka cbsteadky fe, ARe pre cco of
Memory clocwLton too clare .dala Encapsulation oe
“hha
ra Encaptulabion lg R process’ HY momoryy
WMocation to dhe Weonpite membors
ot de chase.
~Y Process af bindin bogethan yaterabyr
ano} ctunctiow ¢ makaatlars comple:
7% Dus te encaptubation, Ro class be comes
us cub te and called out. object «
> Eneapelabion te he process
bul cing Obleck - abix
ae eras) S06
& ' aneapaulelion
|
: aA ’ /
(a ak di y Hike actin ad
7 | , ee finanpletes
(compilation yy ¢ sheen Ya —
object 3- : ;
ae. Re utinee Varttion of lace
“> Tetancr of ve clase '
Ceatebon copy) ;
curable’ :
Q Dit cian tiecle belcozen Clase and) ab jeck ?ee
pi 3 04.9
(ssn) fo oe
hye
See
Dole Hiding 3— ae :
> The memboiee wh & clase Cen ix oO taper.
& Predvede ce
(ny Public
Yreivele i- + fe at We
> Tvale embers Cowd be mcr
oukttde & clase, they con ouly, be
accetable intide &e cass cot ew
guembort Aunctions - Hen’ be con't ‘be
‘tadled by a. object iii a
ublict— ae ; ‘
-Y Public “wiambsrct ay ao clay can bes
acerstable both inctole srr clas aud
oubick ARe clase «dence they Can bs
wecesa ble Aheoughout afc gubine preytan
and he user nan aces public mambers
by ths object ;
Hence Wu provacle wombertt ater rereden
Wadden fam the ser cna} Rie
Concept 1 Knocn at dlaba hiding -Jokuelona '
Aoleree| 4 atest / thew] dLispluy :
At te the preopart of x clan ues y°
ch
which ib tan aceed mambuct ©
another Lats :
ue
Parewk : i : oot?
Say Le ee A 7 sain oe
5 jee clan oa
fas tl Momb cits claw B anal
duevvegy clans 7
poe claw /Pareenl Low o- 4
som lass je .a clam ckple WMEMDene
con bo accotsabu. by on ofaen clo .
Derived Clore Ie ow class whe Can
ae! Re Mambeter’ of cnothon clare,
> dy” CAM af Inberertan ee paren class
Obyeck te moh qacess arty
Miwdege ob vhuctone
A ode er useb ility
weg tah enn ope
the paxcew! clare membars Com be
uted inetd, the some class onal “thay
Coy be ued incidk dhe child clare.
Hone ve ee rerabile ty 10 applicable to
portowt clase fnamberts .pedecHon In usable. mamarcy spate s—
(usable Memoreg ipa t obyede )
only pie memottuy tac’ id cree ated 8
tunable memory spate fs jeoduceal -
Types =
4. Qingke > 4 qoreh t £ cbuldl
+M tiple > Moy pases nh tho
: Mud Level > Many lve
Hicrowchical 7 trees meaner feet chit
tatd
(ms?
+ id= mixed
: , &
Multec 3—
many Level
Ly am whurecton oe
Multiple no. ae div fuera tenet tee,
Lomectod cloqedRere to form multilevel
(whe petance 40 Ral “every parcoul Cue
hove. maximum 4 Chétld ee
i Mm Ay lure inhesaderner “fRewe cree
cn 4s a cade geit of eLosces
(edb 1 Ay y parent Class -
i) chitd clase
WW entemed tele class ipaces chau - whith coat bey & child
cliid Clase — cil h he not a portend 4
Solemed ied claw aubeeh wea Oth parton
' ound tdul
© Yteronchical. !-
od |
Polymorephitts 0
Poly = maw
eppnephaen ~' Gorus ; i
» Utlun, Bue objeck /funchion behaves in
multe wud «BW we, they axl
polytore pluideny os
Po ortpeem can be sf a types .
) Gadle polgnoep hte Ce ovnpile Aina)
i) pynomle polymorephtem Crem fine)
whack ; dt vinckual func Hey :dali polytor bu'vy I~
4. tiny overloading , duunckioy
)
OVe tetee IMJ 7 opert ore overloading
Mettaye “Parsing ie
Sr lalher\ ebjecds can Comimun cats nated
\hemeelved rier phenomenon 1 called
ase aye paseiuge ,
9 Copy Cutan:
Dol alian ee i
> Wun a cha Coukasus - objects at
amothut clas ot members then the
Mechanitrs dehe ction
a nated Clouse 7 Lomptche -
Functions in Ott tH oh ale
L of 2 nos
Hindluce >as>b3
: cout x <" Lacgen is"e< Lan ge (a yb) 3
j
int Large Cink a, th by
14 Ca>b)
reefurtn 4
le
reodurty Bs
begsde Io Jott We Tune tions 3 ice
Oudtiue function 2 e— Durcnng, « fun cstioy call *
eve {¢ a& Jump ‘ind eucliny reo r
mon duncfion dg tert decitiaedd Aun Hoy.
andl after oxe ulion Rowe lea
ae Ulf ond ton fo et
pump tom usa
may aan hoc Waite 16 W
) OAC fans Cae jump ) 6
ween te thc advasdag We ra
funcftont ;
+ ener. a Sunchion ‘core, HAL exacushion
happens ovdctole main Is called
outline Aunedt ioy «
Malic unc Hoy : ia
sine, to
> These uncbions cute
avoid Ma con shage wf) At duseeg.
sump
chiees
> Tr avoid jump de “eel sh whens
| oe ches colbing part
~~ Henee exe culion sh Inleve june”
and) the
hoppenr insiele w mou
tootborye ‘ed hue due to jams!
ake avotded .ub ha adel Cat & » Ine bd
tud C5
cratb;
reduarey «5
maim )
{
t= add ca bd;
5
Dieadvaukanes : oe :
Aine Ake tupheuchiout durte copied +o wey
dunchon franc) 4, once he wu of
Hu main uinction Increases ound
bocomes oewar (9 a) anodton :
Limrtaliom TE wv Foro is
4+ They dould nol ue Loepe
5 «5 thoula wot be reece ut te ,cere eee ee eee reece geeeeeee eee
Defaubk he gumente o— byt. 04. 29
<> tk add (int a, iwl b)
cou <4 af b5
I
main ©)
lick €Q=10 ,b =20 5
adol(a sb;
t
add (a)
Cron :-~ Too Few ~Lypcy in call fe Gusher
add Cink, ind) i
add (to ,.26,30)
tO “Too ma oxime fy exit te Aor
add Cink | ‘wd sore
: [oe —
> ot add Ciba yp tah bbp,ind ¢=26)
cout 2 a4'bS
j
mon)
ddl (10 120 ji) Meo(to 4 default + ducgume st)
add (5,6) M8L Cotede Aefault a
ee ao i he cleefanlé valve
/ (b,c ane chefantt
ade wy a 10, ee default des)
LaasS dan aryument of a Aunchtoy if not
Supplied by Pq ute, Man come oudouralte
uct Can bo taken cor Ae aregqumen?
called os default valuer and We
Cea pective nigument 18 calleol derfou Lt .
es ‘ , ’
> Fore Ree Purpose the arcqumente edd *
+o bo ini Hallixed Autti: De Aunebtey
detinotion Coody) ' ie aii
> AV vegies oe seghh houd side
th a dedoult ceregurnne aif a
taken defoulk -
2 TH b os tmittabtecel Ren Cyof. 2. botUL,
be intttaltaed . i
adaCata, tnt b-to, into).
io an < ike @
aman es état ara ) ants
in void OE Cob i A)
o Minntim 0. BF ares umeuk “lo acteochtey
Ye L Cyotd. hedda ly pe)
So The Ae aegeument fo a Punction ‘can't
be taken as darfault -
otf take seh an urent cc ober «
uo will taka Odd Os :
_ Gig fe by defatt
Ake af laps void «Advent age of default ntauncad se OU
sy cluncltoy overt \octdbing. : ;
yee i
Fanedion Overloading *~
+ stele pe en orecp bt ary on compile ue,
Pelyenoreplaieny -
> Mullinle dunedient Waving Same owt
and diddecaet ovgumente ace loaded
tuto Sea cumony tte nde duccifenenk_
pelt ot ties C+he duncbioy ‘ allocabed
only whey it niecdk to be calbed))
Charachercifier pe 20 04:24
4. Come named
s. plefeen) txgartat
3 teased Juve
Cate t
a. Overloading by choxgitg, sunban *F
curcquim on -
B., Overloading bé changing data-tyt |
angumenls Keeping no. of aucqurnert amt -
cose 1
Void ad& (ime a ud b)
touk < the oeluad ourgumerdte cree comidene as
rectesmn ca to. cigluad“oltgueniante
xl “void dig int 2 om
+ hia.
coukenrs IM
vote way ©) |
(ub acto
Ak (A %
at ts. ;
Couk cca y ND
¢ ‘ +
~ disp Cink 9) janow)
ee,
io
cooks MES Gall bys vedas
i CK coy 2% 1'6
TAMyVLol *
tnt A> to
csp (4) 5
a
coddday MNPoiwkaws 5 ~
> a ie a memory localton reba ahoreen
adoleere A anolhoe memory Locabton .
edecloteatton 4—
ss
int DG
(ov
(MEK) >; : on
Set ny fh eget. pointer ,
~» Poindon ke reg ie ol abikype < 1 f
(uodified form ‘ef. pre Aafived olaf« fe «
> dintogert porter cy fedescee ut con Pores
wad cor of CLM ib eer, Ascbockype ,
Bdichense asgignnest cto pointe 2-
PH Aan § # p lea porubar yo X-
Glad neogs B vON Be
promt? Pada: jpdirecel access
pedal CLA 0% RDA pmndinck- acest +
Acholupe oP paiuber mrunsighed Long ink
: : 8 bytes .Ucatton. Bl Polnf are OL 94.09.99
Ae ts ‘lo fan ‘ney = Ob? 4904.92
Poiubert Vowu bore | address a she lili
main (J
i .
rt ve p., wld 5 2
ake yy older assiqume
au Cit 03 t4S3 544d
ACU Pie
"eybaxt no" 5 v.
Couk << sist
cin MG Jj —prin >> {P+ Q)5 Lgl
.
woo t2= S002
couk cc TRe edemewte, ace \ 5, cat
doe Cicoy (ey ttt) .
He Co EROS
mG Cour CHE
mos 0)
Uh aap Raye He AGC Qed,
“ATOM nyc) phy
— tak Xe Anpuh ao. of rt otog in tala!
Lind >it ssc ; ‘
i.
Ve 45
YZ; |
cout << "An put clomentt af isd maleerc"sfens intd
mjeoseesitd rian
Pig eee tears load
ae chee
ney, Chores Bh tag les
i ‘ chp
tabs ene ot and vaakoit's ceutee" Sopsl weap aah eal yoste’s
aaftedeo ices wt tind» thea 3
Be Amdo de esitot Cea caBabeng 1 ceuctuee is an Wer dohinrd dads
‘yee ;
> Arata eee mY Aiedonend meMNorey-
Lotabion with coram on WaM4n while
ciemchute Comelns W dtd ercow Mor
Location colth Aish ortenk names -
yt ho collection of yoruba with
Aithartank vome -
Declatabion 2
7 a OY WOML of Anuchure
= oo Coda typo)
{ut Tink ie able
Cyd ot, [Ct S|
: A\oot Ce [2 ee Sea cccaas
fe 4 byes
,
Red orconce yates able Pio dieucturee f-
41 yg. jaws in do MTNRIEY artea
wh Aractiute Jaba type :
rut abc co
LV —~
Aalabype. variable name +
i
Chartackerci HieAecersing members of 0 ghenebuer- A
cow << K; G5 Pe
Cin >> K, a4
NK ceases Opera ox Cute fore peremics ion
roe aapltee h lo displ uy /xrad )
J. Stenck obec ¥#k;
aul << K-40;
Cccass opercaten “for poten
reference varsable
Rs Addi sion f Q Complex Oe 7
Creek complex
2 age
r
maln( ) HH
‘
Sth Fate 4
shreuck complex Cr
couk cc" Anpub real onal ay x isk my
Gin dd atta >> a,
Couk <<" 4a pul ral on mag of ond uj
Cin>> b- cial >y bevenay
Cato) = pi. toa 4 b. cal
€ HONDA = OO: meg brag 5 ;
rouk ic" dum ieee cotteal << pt 'ex commaseee
HW-cublitaction i Muldiplie adton and Bvitien,
“Arcos oP oh muctuces
% treahe a sheactune sludent conbaining
Kame, ro no ang VW Use Ye |
Pred oue to input andl Aisplouy recog
ot {00 pudeake :
trench Gludan
chan name lol ;
4 iW teold , marks ;
4°
a2
7 > KM ay a
$ acd Ue -
ote shudlent 9 Yoo)
cout <<" Inpul recone of 100 Hud eal’;
Ao Cink ico; tg 1005 te4)
1
ap:
Cin >> OT] namer> ¢0iJ oll>>
4 OTT. marks 5
Cou <<" Recon ds Aten’ ;
ore (iz; ig 100; iad
6
1
ee
coud <¢ STH - Name << ory toll <<
er mauttks 3
¢Potd -Q be 12 fo, 22 a
Paecin a reel ning sheucduces Aron
to efeened 109) ve
D Pewing sheuclue to a function &
4 Addit ton of wo Complex nrembens .
debien, ob Cc onnplex
ind oad, imag i
{
void add Cofeuct Complex ue Peucl Camplin h)
1 _
cout << a.tteal + b-rteal << +i
<4 -Imag tb -tenay ;
§
main )
| thence Complex a,b; |
cout <<" Anpu renal tod rma of ist “|
\ CIN >> oO. real >> Qs 1enar4 ;
\ cube“ Aopue reeal and imag f and ws
Cin >> b-wteal > b-imag ;
[add (a);
5—————eeeeeeeEeEeEeEeEeeeeeeeeeeeeeeeaanmnmEU ee
) Relure Win, - Chreucl caees A reo Ol Au n Bion a
Quack Cornpler
4
4
int ree al, veneeg i
al
void C Quel compurx) ada Corel compu oO,
cfiewek complex b)
rch Complex ‘> Ns alecnalive
oneal = teal + “types Arench compuxC;
paced 5
J) Codd
slenag f beimag 5 ne [
Cima = a
reedtuten ay
4
mot ©)
‘
tuoi camplax abc, 4 8a), a
couk <<) Tinpwh - etal and inna Pt ate
CrA d> aengal 2> OL enceg 5
cout ad “Moped renal and imo4 f ond no’, |
cin ty b- etal >> bimag : ;
c= odd (a,b)3
coul 4e “SUM me Ce Tees
Co tena
Jc Etlec“Alien nalive (oud pud of Aype ef )
typedef ral chav
tupode? Moad ind
Ul eucl abe
8
chan m5
mt ys 44
1 J
man C)
coud << size a (oPrencd wb 5
¢
oudpub— &
Note =
af: typedef int float
Dan Qixee 4 -
+ Presorerty i¢ given +9 new dodo.
he Ry. tL dj th
Nieto} eleuchewes
trench. abe
q
fa chon Aiton Left side -DLN os,
SHrutderne “Union ;
D Morons ollecedion we Mew ony aMocafinn ie
: pac ( :
ofedic /tonapile [tne + Aynaret Jun Line
Sede = OO wt ann -
= Gum WF size Pal giae OF barged
voutrable « Memberc
24, struct abc
j
mi ay 4
thon b; /74
floal cs 44
i La Met FC ofrenc? cabo
Vt
ay. uiwien abt
) 4 as “2
Ahan bh} vs
Aint (se
cout 2< Ua © (Cuem’o) abe) 3
/) 4
18) dPowoar in cpt 1) Hloedke a poiuber sto an. 4D oreo
> maint)
ioPaet at EoHeP ;
a
Aoncti~o .
tt i, W100}, Hp 5
Pzak's
Fon Cicos Netoyttt)
_
prcinkt C" Popul nol) 5
scant ‘« a pti) .preentel CtRe owas) we \n ds
don (isos 16ios Tt)
{ peivtitet td”, aCPH Ds
t
}
> mane)
{ We cs
wd 35 a
recta 4) mablee Cre size HUB)
Gon Cis 051105 144)
pec opal no") 5
sean C24 A405
pondd () TRe ateay is \n')5
dom (iz0 4 iciog fy4)
5; pend (24s x (PHOS -
Crew (235
Syntax 3-
}
ee ad, tin),
[ene Agme = oe ») mate (fod * Jab)rer SernP ne mene eee eet
Lalor)
_> Alipcale a poinker to aed On kar
Spank — aie
Sere a
i £
ain : a a)eattee _ ea dake Cte :
eee peGnd x) cabloe ts, 9 ¥ Cal tint)
x(r(rr) +)
— |
teabloe 1) 4- pig 10-99
> It ie used Ao modify on existing,
Memory oMocabion -
we *P
p= = (ik *) madloctio * sit P Owl);
P= (ut x) reandllec( is xo dixe ae (ink)
real?) 5
"> Reale can be used ofl wodlec C)
ore caloel ) :: 7
New operator + t-
calloc arte Memory +
weed | to Aynomncabley
> a veucable > 6 dunction -
Yan anrear
A iene Baee / union
> 4 obfec L .
Lined did oe
euch node
int Aola 5
otreuct node xnext,
¢
moet)
renee rode FAS
a= ( streuck node ¥) malloc (ebesat Coheed
7
x 2c) xb
a= (x4) malloc (ore of (XD),
Suynckoux
int €P3 allocating hice
P= new wt (io) an CUTE ot olemenh
Ex. wh HPS pointer. te & ermal vourtrable
p= new 1 ;
xX FAS
a> new % 3Delete operadpr t-
Usrod to Aertroy memory allocation
owe by need oparcalon .
c- 2 we
Qrntw X 4yo Cloucer and Objects
Chaedor _
ae Collechion aL
) Vawinbles / decks
» Aenctions / Code
Ss equtvalewk +o a ghreuchereee :
> Momborr ance oF & -ypas
reaped i) preivale » Rerlrerched Scat
vacieblt 1) public > un reeeher heal, ep pre *
visabilsty /Acease ils by in a pragrean
Preevebe
> The mombeir Can ouly be used iuithin
ke close , not outside -
= ban oily Is we ineiole member
fe cing : '
peclarabion ef a Clase pb 1g. 10. 99
close larsnome
of clase Ort
preeval
rr ovale J /1b4 Aecfotle- memb 2th
P Aoredite I enna
Stile ly coggunel
rictuwnftote hurl
public 2TH Tunelioy Coregeame P);
aad afype 1 vest. 5-
wk Clos 4
}
' “yk 905
rah «| Nuch 4
é heblee :
wubtie <— voto} add (5
J
ae Clare A
i
public °
ing Nn, 4
prevalle
ime es
Public :
ind m9 5
fs
A class 18 O usere dehinesl dofaly 0»
Declares Object of a Clags s—
oo
> Object a a class ie equivalent to resefouenee
| voursoble Aon Re clase -
> To acces Re members Cpubtee eee
ph a clare we fake Re help of object -
Canta i
clasename obyectname 5tx: | : oe 4 a fr YF
inf Oo, i ,
Publee 2
void adat)
" te
coul << Aopud 4 noe;
cind> KO7Y3
oe :
coud << gum, 2S CT q i
f
By Neat |
maoune ) eee
i hg
A obj, 4“ apt ubation
> obj. add 5 (ontnetet)
reaprese nl OAL
> Each object af clase
of! membart -
cory wf He entire sek
Aecsecng rans mMembert b obted -
ahye rk name - pambers
ex Aloe
public *
imk 4 5
5 s
main (>
a oby 5
coud < "Eq ped
cin >> wb) % >? Cb} + 43
cout << "dum Is" << aby. x pobj-y 5
"
Q noe 5a Claas A
Q
ind My ;
publte:
void added
touf << "Aopul a noes
cy >> ry
Court $< "Sum" Sing the violate. security oopeefs hence
Fruands funchin cue Rot adviaable to use -
Usages— ae
4. flies, body of Aciend function outticle
the class -
8: uldhin He clase Ficieng prototype must be
Aeclarids tn
3. AE lo necessary cto pass on object as eg ment
-to diutend chunclion 2y
R- ade 9 noc.
Class 4
inf a bs |
[Arete nl voiel adel (4) 5]
veld add (4k)
cout <¢ "qn pud 2 nosy
Cin s> Kig o> Kb5
Louk Se "Gum fe" eK KAT K'DS
$ .
meu ¢ )
a KS
add cK) 5
Fiend Function Common to multiple chasses~
Cass B35 HE stwara Aeclocetion vt B
CAoxs A
f
int 5
Friend | yor add CA» B15”
chat S
iW =
Artec void adh CBD 5 1 enaine)
id aad (4 8B HDT gs
Couk 7 ob}. 9 bt 4 9 abhi
cout <<"sum" << bh}. +0b4-4 3\ Bs |LL 10 BB
Static membere af a hast 2- eres lel0ee4
d.
Compile tne.
4. Clabie Membp tc yartable.
& aalie member. ctunction .
3. adie object
Stetic meraber yascdble 8
> Member voreroblee curee Vor obel dui ag
Compilafion Lime -
dect Gelade — Odette dekclype Vv orci able name 5
> tobe member yoreablu mud “be
intktalixed to come vale nude de TH ow wal value cee wir ped
by cefaule 6 will be taken .
ind ah TD :—EeEEE——EE
mo Cos if
» ohabte inl HY
public
void add)
; cout << % d 5
|
(il ae IES]
/ Tod main
{
/ A ob ;
ob. add)
4
at wt RE HS a
Prog wi) be akan ox 0%
stabic member. then oo mumbert unchion te declared
chalice , all members used side ie
cute taken to be cladio ‘i
ffl Publi |, .
Vatahte verd add ()
cowl << % &y ;
wid meine ff
7 pA add cas Foe> A otetic member Auncdien tan be
Aire ey ae \ claw nome, ond
ane Close
tative tah og ;
public :
ia vet ade)
uk xe EH |
ey , eee”
ME A= 109 HY = Ad;
oy main C3 ' J :
Ris addt);
] |
> All mario’ cute si faker stele i
AL menos, arte wiltalined to ‘0 -
eK. Class A
ink WY, KS
public !
vord chow)
‘ tty vt
gra ee
ait, ¢t
Couksd % es : NSmain 0)
i ak «8
bb .qhewl) 5
Declare wpernber ctunction, lire: he Cay,
> Preoforkape wil be a ineide he lax
> “The body W oi oudside The hore
using Shope ecuslulion speeaton
hy. Class A
t fl 4
Public «
voi o| add ag i ercotatype
Waid it addc)
coke y 5
i
£5
a roaabenth P (Seope errntetion op.)# dratay of Objeck psy
G: Creeat a late cladent having wame , toll no
and marks ox aaembert vorterbler on
Ancien ‘Popud lay inpud Ada, Hie
lo dicglay ha ed « of ohucleat ; p
usiug sr above clan -le Aieplag
taco af (0 eolende .
Class ¢tudenl
|
}
chan namelo] 5
my reo y Martk’a §
Public +
void impul() 3
“ Veid aula) 5
vets) sfudaud 5 : mpaf Cj
i couk<< "Ta puf names rol and marks” 5
2 CIN D> WOME >> KoULS> Marks 5
' volol otedenp ++ Aicp ( 5
Covet << NAME << toll KC marks
may (9
thuoleat Slo) 5
fot Cmbinos iclos i 44)
YT gtry input 5
{