













Study with the several resources on Docsity
Earn points by helping other students or get them with a premium plan
This page cannot be seen from the preview
Don't miss anything!














a eS ——— ny 5 7iline tae a request mot conrraals . Sn lin€é When & Te TR functon shar {3 expanded aed -.\When aoe “oune.-anenan 812 Solled ewnos — aa "__-€0de get tnsertea or subvettivied: at “ine Poti ofs furetion” ail, i fale rermn-type ~ Fund 3 = 4 eee D i — a feature: fn C+F Wier have same mame & ~ * Funetien Overloading ces Fi two or more fundtions can i different parameters » a7 Void prink (tar ZL) 5 : { ant Meer ‘ uw 2 j ut << CVE sais << 4< end / i fj Noid print (Float i) E 4 ___ coutr= “Static variable in a Function + ee fq Wek eeseate, spe er ee Sens a lifetime of tne program - (defaut @retalized to oO) ia Even € the function i called mv (tiple Tioeay the —— = = Specter Wt 18) a@icaated «ences i, « Statice variable %n @ class - — Declored ‘inside the cless body ¥ = Also known GR closs. member varidble . i. They muss be) defined outside she class. FT 7 Stetle variavie doesn'+ belang to any object ; “bin “ne Whole class , i) e one Here will beseu, copy of “Statle Memper Varah ¥ for -ne Whole claga . rn Ex olVass Accoug+- " 4 aipawWare H ‘tnx balance; Stare tek vo? ; [ eo | (pated F Noid SerBalance Cent b) 4 Essig 215 | ie __ fintalised ovtside oss Sear Account 4. Ye i = B54 Void main Z Acer ste oa ie | 4 Sc | OOPS by 7 pbpieeky! “SOR M80 betudectored aa igtatic. | ae =a — Satie Account aL; aaa = Pao onaton. - —— —_] + Statle tunction tn eau Gieas E= J eee a Storie member funcriong are a\Wowed +e acess | on ne __ Statice aata. Meni bere ot oer StaHe member funciona . re i iy ~ eConstructorgz « rn SS > Constr csore ‘2 an special member yfunchionn ef tne Class. ae As aw tomotica Ny fnvoked When an lb ect IS ~ created. i 5 TE has me return aype | q > Constructor hos Same Tame as, class tselh => Tf we do mot specify poten Grr aompiter generates Q default — Conmptructor for uz. AS) Consirvetror Default Porometerized copy Ciasenamet> - Class name (parameters): glass _name (gone ‘ tassname Los> update) Pum updote Roe, Fur qo "hl update (const ipdare 4 4 f San 2A) G=10; 47] nant Gey 4 Ga P24 | HeSweee some scin eT Be P25 | a oops by L—pecructor ee coe peapuct es 18 @ member function which aestructs or }— deletes an object 7 _ Se —s pestfectos — don+ Rake any argument and dont \ payne any yerurn TRE : oe = ony one destructor ie poss ib\e = Ddesrructor eames be Srerta, 3 Aetvanty destructor doesnt destwy oblect + It ia ane “ast Ronerion that “inveked before object dhesrrey., em 1 = | ea eae Oestructer 1% used, So that belore aelerian of cb} we can ree space ANocerted tor thik Vegource. Ble ‘ if ob\ oer deleted then — space Allocated for ob) Wil be free bot yesouree choean't Operator Overloading. c++ nove “he abitity to provide special meaning Ao Ane operttor. q class Com plex { cee Complex — @peratar + ( Complex LoL) A Camp ex yeR | wena = ey Gay FEB io = C25} 10 OOPS by Ast! conte aad compen TOR _avect bof? We Wie Meme = function wipe eee EE = Fane Keyword | b Ove Sk. dni tee this. a mvt = Shc9 Friend Class as ee ee frondem Can aetine a Wi needa write operator So, wei use @ all ayo ie A friend claga can - nemberg. eb lemer cess sans whieh Th ois daclareg a : friend. ns a ~ “Were can be frend class and friend fuecton. Ee lage BOX ei a f 4 ornare : aa 2 dable wide § 4 L pe bile & a friend oid Prinlidth CBox box); Neid Serwidin( dewble Wiha); , Void» Bom? Beniatn Cox douse wid) 4 width= wWids, ite Nold print witch ( Box box) I 4 Sout ce box swiddth } /Leaenie = Sime maind) | 4 Box be x } Pox) SEL Wi aty ( ayy Print Wictind box) s SS ee — TT OOPS by = 9. Multiple “Thheritance : Ee ae 2 lass Aa dlagg AZ = ae Res Ef ————— - 4 AE | ae re te = i @\ass 8% public Al, public AZ i _ s al a i be £ a i. < A a). Heirarehial ~ Thheritance = : 7 z 7 a =i Class 61 : Poblic A te re a > = ii i _—5 ie [ox aul Go =| Glass B2; public A i f t “ > Nisibi! ity Mode Private —-— —frotecter A—bose Class Purr a B- Sob Class oops by a 8 \* SubCloag “anasivisibiiny Mode 18 public. | ea pene Pio Bloat Aw (pet a bi ae che a ee it | aan cal S Gren public, Member With be _ public 2 pBeenwna proteac RES e+ed . oF A ant 4 ae Mode is Prixate nen. boan protedes ana public Member of A Wii be private rember SF ) ae a Relationship 4B alwaye ample mented ano” ee An herttince . cesta ai - Constructer and destructor ‘in dnheritonce | “Tae ehilad class Constructor wit ron uring erection For cbjece ot Guia 1¢4Ss 4 bor as goon Ye obj & class coverrueror YUN and MF wit call ana Gther Ane ecu [ geared chi id eeacuen of See parent Nags | oe gorent dass censueres « OWI) @egrne St compte ection , | ae oxen comtrucns Call 4 : aie gow. AG) ] 4 gonsirucsor EKEr 4 a I Ww ie v1 Cafe € Ack vers; Ona conk- | five on a al 1 ex ee 1 \ a} id de YU | SS ee eS eee then EM -Aexe, exe Cured. (0 Conky q fi (ae 4 i SSCA vara Gop Ete a u OOPS by 1B lachievea at Gompile time, “ eee An Qearne / chang ¢- a pute ‘ nat 8 Nolg @han e-gear ( §nr aenr) Pad F] ¢ et ii ao cate je Clasa SperigGr + Porlic Car ——— yold enange-qeas C Bn gear) a 4 me ear > S-) 4 re} | COT a + 5 a Fag \ a Ante odin | RE ES BC y ia e+ Change gear A) } aaa ; (8) — 5 ee : : Ta Cy peeass will bie> “Ealleo: pts 4 function of speris “— Beat: a check if any fon in eee)" Claes. oth erwit ene, Car for all except oF genera : 16 oops by gy = Nirtwal Fonction —— if; “. —_— TEBaa Wirtval funerion is a member function whichije = Byte bee sn “me bage zM declared with a ‘yierval keyword’ Se $4 e sive cl = and fe declared Coverridden) ial vay desived | clags, of derived Clon, Us|) ee When You refer +0 @G abject you ean call @ ‘thre; Be fie. veka TS. ty bose class , — of that object and execute ne derived CRs el Version ef +he fonction. ‘a oe Se ee ig Rey re Used tO achieve Run time Foly mor phiam . = = Viral Fonction Cannot be Sratle and also cannot be tig, A | be dunetion of Gnother clogs, SS a —___ ba Compile -+ime c Early binding ) \ls Ron-+ime Chate Sindin 0) V ; ke @loss base ‘ ———aee i 4 Public : i Nittal void print C) i 4 utes Tae) eeeave Se << Gnd} : eee Void Show ¢) 4 Coot cc Bose Show fur" i << andl} | class = de rived 4 8 Poblicsic Biw 22p 2 eo a 13 Vo ld Print c) ' ; are Zeal Fa aout et derived Cringe! <2end\} rae Void oe Pree ‘ ——_—_—_ 7) ed fan" << avai) dicey a OOPS by | = = avira TABLE : a | N bed For dar a NPTR Fi = he lie a nie om VTABLE for derlved Gp _ ] a) aI ' a Pure Niytval Function _ Toes wi and a@bshact Closs O04 = palbnid pire? -_" Sometimes @mplementation of au function Bnnet be a, g tn +he base Claaz, Such a Class 8 cated OBS tre a * 5 drawd) a i (Shope | < (Bot there: cant van, ; : ES im pementetHon rah f 2. n