C++ NOTES
C++ NOTES
-
Ansc44 isian Dbjee drjented prDgrammlog landudde b-dh sn1C6
c 4 4 qives progrdmmer a hlqh le vel DE cbnhrol over syctem
b a dnd
Memory.
c44 is Jot OFwell- shdcured dnd sdfer ldndtdde 4hdn c.
slila obab h d bothid bob 9lbtroi nlla9se
c4+ is next
vers 0n dE C.
hotbil nb sbetobuA
7Wha die Advdntdde DF CH+ ligdat-
cHis an object orjeofed
pidrdmml nd langudde.
c+ PDdtdm Is dse Ful tor tew-1eve prodrdmming ldndudd e
eberbsilns zl 2922h/
3 Whad Is dIHerence bctube en c and c+
p1tno
dbpe9
tdsbes9-9btnbUbA
c++
els pdcedural ldnquade ob - c t ls prucedura tobject driened
PrDdrdmmind
datd is NDf secUred -
daBd 1s secdr ed
Mapping between datd and Mappind beltoeen dakd dn
tuncHDn Is Ntt
pbssIble.d 10dFuncHon s Possi ble. fyDUgh dbject
- We can nut use new dnd delele-We cdn dse ned dnd delete
oberator operadr t b
We not use uncHbn
cdn
he shucure.
inslde-We cdn use HoCHDD fOside
he shu chure
193r A
c ddes Not sUPPorHod TuoGHbn-cAf SUPPOHS
DVerldddin. FundbD
DverldddIng
4 Feaures In c4+?
to
Ans. up Df
datddnd Fuo cHDO
EhcapswaHor:-Wrappind
0ie3ui
d sindle uot s called ds EncapsuwaHDn.
Advandde - datd securieH.
Adudn+dde-Hexibi|\h
5 deHne ndmespdce in C++
4 b
tbjec dnd iniHalj2e
dsing andtbêr objec dF he sdme cldss
hype.oe
-
slyctenal foooubib
14 s dseddet proper desuchor calls hom derived tb
to
bdse eldss when he bdse cldss poínfer holds
derived
cldss dunamic cbi ect. s Utene
9 Wha} ls Hush
in c+t botbbglinvd adllbnb blinitN
Ans:Hush is sed do Sunchrdn}ze the dsst
wh is claded stredm bUffer
cDhd|led ourut O nu
sequence
3) Wb C+ cdJjed as ObJect
br|enfed progrdmmind Piaibotui
Ans Becduse cH ntd 2
dndudae vleD a prDblem in frms iOf objed
1DuDfved Tather hdo he
pocedura for doind i4.
OOP Is do
prbdrcmmlnd parddidm bdsed on he
datd in he toim cbncepnlgar
DF objecc which may coains
DEHen JcNDN as
DF Held
aHrbdes dnd cDd e lo he orm
OF
pDcedure dHen nDn as
mehtd
24)Wha 1s FundHDo Bindind
Ans: Resolbing a uncHon call c/4h s proper FuncHon, deinsuibo
hobd5
s called ds tun clH dn bínding 29qpt dau hr
Rererence poiter.
Reference vdrjdble must be insalized. |pofnfer mdy or mdy nbt be
iniodioed.
2 NU reFerence ts
NDtPOSstble,i a NUtL Pofnfer fs possi ble.
3ReFerence vdriable cdo not polny to 3) poiner can pofot fo dny vdrldble
dnDfher vdrfable a dny Hme.
s) upon success it return etdct poiner 3y Upbn suaecs 4 reuns vDld pojyer.
Hpe
UDId 4est C)
a) By b i h þroperes o sdure
2By blrh properHes bf cldss
dre public. dre private.
3 1+s used tor IniHalj2aHDn PUrPose. 34Is Used For dctessing or mbodT Fy
he dttd
Shallbw Copy reHeds chandes made to 9 deep Copy ddesn4 reMe ds chdndes
he neo copf ed obj ec In he mdde to h e neo CDpied Dhbject o
orldina dbject he ondina) objet
diference betoeen Member Fuocibn dro friend Fuoclion ?
Member HuncHDn Friend fun cHon
>Member ncibn belbnds to same Friend Huncibn not belonds D
cldss Sdme cldss
2) Member runcion oill hde nfs ) Frend FuncHon dees not hae
4his pojoHer.
Polnter
3) member FuncHbn toil Inubke throuah 3 mend FundHon oi invoke
he dbject CDILhbud dbject
Conshyor
despu
ctor
CDnshru cor uonstrycHnd he objet y destycor desboying the object
suokaa AC) Suntda AO
INe cdn pdss drdum en to he | We cdn not Pass drdum erd
Conshu cor tD he desty cor.