C++ in Hindi: Kuldeep Chand
C++ in Hindi: Kuldeep Chand
C++ in Hindi: Kuldeep Chand
So, This EBook would not only be easy to learn OOPS and
C++ but also very useful if you are interested in learning
Java or .NET Language like C# or VB.NET.
C++ in Hindi
Kuldeep Chand
1
www.BccFalna.com
C++ in Hindi
C++ Programming Language in Hindi
Copyright © 2011 by Kuldeep Chand
All rights reserved. No part of this work may be reproduced or transmitted in any form
or by any means, electronic or mechanical, including photocopying, recording, or by
any information storage or retrieval system, without the prior written permission of the
copyright owner and the publisher.
Trademarked names may appear in this book. Rather than use a trademark symbol
with every occurrence of a trademarked name, we use the names only in an editorial
fashion and to the benefit of the trademark owner, with no intention of infringement of
the trademark.
e-mail bccfalna@gmail.com,
or
visit http://www.bccfalna.com
Phone 097994-55505
The information in this book is distributed on an “as is” basis, without warranty.
Although every precaution has been taken in the preparation of this work, the author
shall not have any liability to any person or entity with respect to any loss or damage
caused or alleged to be caused directly or indirectly by the information contained in
this book.
2
www.BccFalna.com
C++ in Hindi
ProfessionAl Developer
3
www.BccFalna.com
C++ in Hindi
Index
of
Contents
4
www.BccFalna.com
C++ in Hindi
Table of Contents
5
www.BccFalna.com
C++ in Hindi
Arrays of Strings .................................................................................................188
The weekday Class ............................................................................................190
Functions ........................................................................................206
Function Calls.........................................................................................................206
Function Definitions................................................................................................208
Function Declarations ............................................................................................211
Standalone Member Functions ..............................................................................213
Inline Functions ......................................................................................................213
Specifying an Inline Function .............................................................................214
Member Functions Defined Within a Class ........................................................... 215
Member Functions Defined Outside a Class ......................................................... 216
Revised weekdays Program ..................................................................................217
Macros ....................................................................................................................220
Overloaded Functions ............................................................................................221
Default Arguments .................................................................................................226
Declarations and Definitions ..................................................................................232
Lifetime and Visibility..............................................................................................233
Automatic Variables ............................................................................................234
Register Variables ..............................................................................................235
External Variables...............................................................................................235
Local Static Variables .........................................................................................237
Objects ...................................................................................................................239
Visibility of Instance Data ...................................................................................239
Lifetime of Instance Data ....................................................................................239
Creating Static Data............................................................................................240
Accessing Static Data.........................................................................................240
Static Functions ..................................................................................................241
Reference Arguments ............................................................................................244
Swapping Integers ..............................................................................................244
Passing by Value ................................................................................................244
Passing by Reference ........................................................................................245
Returning by Reference......................................................................................250
Constructors ...................................................................................254
Constructor Arguments ..........................................................................................261
No-Argument Constructor ......................................................................................263
The One-Argument Constructor ............................................................................264
Initialize Array Size.................................................................................................271
Initializing a Member Array Elements .................................................................... 276
Copy Constructors .................................................................................................277
The Default Copy Constructor ...............................................................................279
const for Function Arguments ................................................................................280
const Objects..........................................................................................................286
const Function ........................................................................................................288
Operator Overloading .....................................................................295
The operator X() Function ......................................................................................296
Relational Operators ..............................................................................................304
Assignment Operators ...........................................................................................307
Overloading Unary Operators ................................................................................310
Prefix Version of Operator ++.............................................................................311
Postfix Version of Operator ++ ........................................................................... 313
The Unary Minus Operator .................................................................................316
6
www.BccFalna.com
C++ in Hindi
Conversion from Objects to Basic Types .............................................................. 319
Type Casting: Conversion for Basic Types ........................................................... 320
Conversions Between Classes ..............................................................................327
Overloading the Assignment Operator (=)............................................................. 334
Overloading [ ] Operator.........................................................................................341
Constant Overloaded Operators ............................................................................345
*this Object .............................................................................................................349
Inheritance ......................................................................................357
Reusability ..............................................................................................................357
Inheritance and Program Design ........................................................................... 358
Composition: A “Has a” Relationship..................................................................... 359
Inheritance: A “Kind of” Relationship ..................................................................... 360
Class Hierarchy ......................................................................................................369
Reusability ..............................................................................................................375
The Base Class Constructor ..................................................................................379
The protected Access Specifier .............................................................................379
Constructors and Inheritance .................................................................................381
The Great Chain of Constructors ....................................................................... 381
No Argument Inheritance Constructor................................................................ 385
Arguments Inheritance Constructor ................................................................... 386
Adding Functionality to the Derived Class Constructor ..................................... 388
Access Specifier.....................................................................................................390
Public Inheritance ...............................................................................................400
Private Inheritance ..............................................................................................402
Protected Inheritance..........................................................................................404
Composition ...........................................................................................................409
Multiple Inheritance ................................................................................................417
Pointers ...........................................................................................428
Addresses and Pointers .........................................................................................428
Pointers to Objects .................................................................................................434
Pointer to void ........................................................................................................438
Pointers and Arrays................................................................................................439
Pointers and Functions ..........................................................................................442
Pointers and Strings ...............................................................................................447
Membership Access Operator (->)......................................................................... 451
new Operator..........................................................................................................454
Delete Operator ......................................................................................................456
Creating Objects with new .....................................................................................459
this and const .........................................................................................................464
Pointers and the const Modifier .............................................................................469
Linked List Class ....................................................................................................479
Containers ..............................................................................................................483
Virtual Functions and Friend Functions ........................................491
Polymorphism.........................................................................................................491
Normal Member Functions Accessed with Pointers .............................................. 493
Virtual Member Functions Accessed with Pointers ............................................... 495
Late Binding ...........................................................................................................497
Arrays of Pointers to Objects .................................................................................499
Passing Reference.................................................................................................513
Passing Pointers ....................................................................................................517
Abstract Classes ....................................................................................................525
7
www.BccFalna.com
C++ in Hindi
Pure Virtual Functions ............................................................................................527
Abstract Classes and Pure Virtual Functions ........................................................ 532
Pure Virtual Functions with Bodies ........................................................................ 532
Virtual Destructors..................................................................................................533
Friend Functions.....................................................................................................544
Friend Classes .......................................................................................................556
Interclass Communication...................................................................................... 556
Pointers in Interclass Communication ................................................................... 558
Nested Classes ......................................................................................................561
Communication between Nested Classes ............................................................. 562
Exception Handling ........................................................................565
Throwing Multiple Exceptions ................................................................................572
Specifying Data in an Exception Class .................................................................. 587
Initializing an Exception Object ..............................................................................588
Extracting Data from the Exception Object............................................................ 588
Exception and Function Nesting ............................................................................591
Streams and Files ...........................................................................593
Stream Classes ......................................................................................................593
Stream Class Hierarchy .........................................................................................593
ios Class .................................................................................................................595
Formatting Flags .................................................................................................595
Manipulators .......................................................................................................596
Functions ............................................................................................................597
Istream Class .........................................................................................................599
The ostream Class .................................................................................................600
The iostream and the _withassign Classes ........................................................... 600
Predefined Stream Objects ....................................................................................601
Stream Errors .........................................................................................................601
Error-Status Bits .................................................................................................602
Inputting Numbers ..............................................................................................603
Too Many Characters .........................................................................................603
No-Input Input .....................................................................................................604
Inputting Strings and Characters ........................................................................ 605
Error-Free Distances ..........................................................................................605
All-Character Input ..............................................................................................609
Disk File I/O with Streams......................................................................................609
Formatted File I/O ...............................................................................................610
Writing Data ........................................................................................................610
Reading Data ......................................................................................................612
Strings with Embedded Blanks........................................................................... 613
Detecting End-of-File ..........................................................................................615
Character I/O ......................................................................................................616
Direct Access to the streambuf Object............................................................... 617
Binary I/O................................................................................................................618
Object I/O ............................................................................................................620
Writing an Object to Disk ....................................................................................620
Reading an Object from Disk .............................................................................621
Compatible Data Structures ...............................................................................622
I/O with Multiple Objects .....................................................................................623
The fstream Class ..................................................................................................626
The Mode Bits .....................................................................................................626
8
www.BccFalna.com
C++ in Hindi
Error Handling in File I/O ....................................................................................627
Reaction to Errors ...............................................................................................628
Analyzing Errors .................................................................................................629
File Pointers ...........................................................................................................631
Specifying the Position .......................................................................................632
Specifying the Offset...........................................................................................632
The tellg() Function .............................................................................................634
File I/O Using Member Functions ....................................................................... 634
Object That Read and Write Themselves.............................................................. 634
Classes That Read and Write Themselves ........................................................... 638
Static Functions ......................................................................................................639
Size Of Derived Objects.........................................................................................639
Using the typeid( ) Function ...................................................................................640
Interaction with empl_io .........................................................................................648
Overloading the << and >> Operators ................................................................... 650
Overloading for cout and cin ..................................................................................651
Overloading for Files ..............................................................................................654
Overloading for Binary I/O .....................................................................................657
Memory as a Stream Object ..................................................................................660
Fixed Buffer Size ....................................................................................................661
The ostrstream Object............................................................................................662
Input Memory Streams ...........................................................................................663
Universality .............................................................................................................664
File Pointers ...........................................................................................................664
Dynamic Buffer Size...............................................................................................664
Last but not Least. There is more… ...............................................666
9
www.BccFalna.com
C++ in Hindi
OOPS
&
C++
10
www.BccFalna.com
C++ in Hindi
tSls Visual Basic Microsoft Company dh ,d cgqr gh ljy Hkk’kk gS] ysfdu tc izksxzke cgqr
gh cMs o tfVy gksrs gSa] rc bl Hkk’kk esa Program Develop djuk le>nkjh dh ckr ugha gksrh
gSA D;ksafd bl Hkk’kk esa Graphics dk cgqr iz;ksx gksrk gS] vkSj Hkh dbZ dkj.k gSa] ftlls ;fn bl
Hkk’kk esa cMs izksxzke Develop fd, tk,a rks izksxzke dh Speed cgqr de gks tkrh gSA Assembly
Hkk’kk Hkh dkQh vPNh gSA blesa fy[ks x, izksxzkeksa dh xfr dkQh vPNh gksrh gS] ysfdu ;s Hkk’kk
Hardware ds Device Drivers ds izksxzke fy[kus ds fy;s T;knk vPNh gS uk fd Application
izksxzke fy[kus dsA
blh rjg Java Internet ds fy;s vPNh gS] gkykafd Java C++ ls gh izsfjr gSA ysfdu ,d cMs
Standalone Application Development djus ds fy;s C++ lcls yksdfiz; Hkk’kk gSA ;s ,d
cgqr gh Flexible o Best Performing Language gSA
Procedural Languages
Pascal, C, Basic , Fortran tSlh ikjEifjd Hkk’kk,a Procedural Languages ds mnkgj.k
gSaA ftlesa izR;sd Statement Computer dks dqN dke djus dk vkns”k nsrk gSA ;kuh
Procedural Languages Instructions dk ,d lewg gksrk gSA Procedural Languages esa
NksVs Programs ds fy;s fdlh Hkh vU; izdkj ds Pattern dh vko”;drk ugh gksrh gSA
Programmer Instructions dh List cukrk gS vkSj Computer muds vuqlkj dke djrk gSA
tc izksxzke dkQh cMs o tfVy gks tkrs gSa] rc Instructions dh ;g List dkQh ijs”kkuh iSnk
djrh gSA blfy;s ,d cMs izksxzke dks NksVs&NksVs VqdMksa esa ckaV fn;k tkrk gSA bu NksVs&NksVs
VqdMksa dks Functions dgk tkrk gSA Functions dks nwljh vU; Hkk’kkvksa esa Subroutine,
Subprogram ;k Procedure dgk tkrk gSA
,d cMs izksxzke dks NksVs&NksVs Functions esa foHkkftr djus ls iwjk Program Functions dk
,d lewg cu tkrk gS] ftls Module dgk tkrk gSA
ysfdu ;s Modules Hkh Procedural Programming ds vUrxZr gh vkrs gaS D;ksafd lHkh
Functions esa Statements dh ,d List gksrh gS vkSj lHkh Functions fey dj iwjk Program
cukrs gSa] ftlls iwjk Program Instructions dh ,d cgqr cMh List cu tkrk gSA
11
www.BccFalna.com
C++ in Hindi
Procedural Languages ds “kq:vkrh nkSj esa buesa gh Program Develop fd, tkrs FksA “C”
Hkh ,d Procedural Languages gS vkSj tc “C” Hkk’kk dk vkfo’dkj gqvk Fkk] rc
Programmers vU; Hkk’kkvksa dks NksM dj “C” esa gh vius Program Develop djus yxs FksA
ysfdu le; o vko”;drk ds vuqlkj tc Program cMs o tfVy gksus yxs] rc Programmers
dks bl Hkk’kk esa izksxzke cukus esa fnDdrsa vkus yxhaA mUgksus eglwl fd;k fd bl Hkk’kk esa dqN
lq/kkj dh vko”;drk gS rkfd ;s Hkk’kk ljy o yksdfiz; cu ldsA
;s Hkk’kk ljy cu lds blds fy;s bldk okLrfod thou ds vuqlkj gksuk t:jh FkkA ;kuh ge
gekjs lkekU; thou esa ftl izdkj ls O;ogkj djrs gSa] bl Hkk’kk dk Hkh oSlk gh gksuk t:jh Fkk
rkfd Programmers blesa vf/kd ljyrk o lQyrk ls Program cuk ldsaA
Hkk’kk okLrfod thou ds vuqlkj gks] ;gh Concept Object Oriented Programming ;kuh
OOPS dk vk/kkj cukA “C” Hkk’kk dh bu dfe;ksa dks igpkuk x;k vkSj blesa lq/kkj fd;k x;kA
QyLo:i gesa “C” Hkk’kk dk ,d u;k laLdj.k “C++” izkIr gqvkA vkb;sa] ge Hkh tkuus dh
dksf”k”k djrs gSa fd “C” Hkk’kk esa ,slh dkSulh dfe;ka Fkha] ftuesa lq/kkj dh vko”;drk eglwl dh
xbZ \
Procedural Languages esa dke gksus dk egRo Fkk Data dk ugha] ;kuh fd Keyboard ls
Data Input fd;k tk,] Data ij Processing dh tk,] Errors dks Check fd;k tk, vkfnA
Functions esa Hkh blh egRo dks tkjh j[kk x;kA Functions dksbZ dke djrs gSa] mlh izdkj ls
ftl izdkj ls lk/kkj.k Statement djrk gSA Functions dksbZ tfVy dke Hkh dj ldrs gSa]
ysfdu buesa Hkh dke ds gksus dk gh egRo FkkA
iwjs Program esa Data ij dksbZ /;ku ugha fn;k tkrk Fkk] tcfd iwjs izksxzke dk ewy vk/kkj Data
gh gksrk gSA fdlh Inventory ds Program esa bl ckr dk dksbZ T;knk egRo ugha gksrk gS fd
Data dks fdl izdkj ls Display fd;k tkrk gS ;k ,d Function fdl izdkj ls Corrupt
Data dks Check djrk gS] cfYd bl ckr dk gksrk gS fd Data D;k gS vkSj og fdl izdkj ls
Program esa dke vk jgk gSA Procedural Program esa Data dks f}rh; Lrj ij j[kk x;k Fkk
tcfd fdlh Hkh Program dk ewy vk/kkj Data gh gksrk gSA
mnkgj.k ds fy;s] fdlh Inventory ds Program esa fdlh Data File dks Memory esa Load
fd;k tkrk gS] rc ;s File ,d Global Variable dh rjg gksrh gS] ftls dksbZ Hkh Function
Use dj ldrk gSA ;s Functions Data ij fofHkUu izdkj ds Operations djrs gSaA ;kuh ;s
Data dks Read djrs gS] Analyze djrs gSa] Update djrs gSa] Rearrange djrs gSa] Display
djrs gSa vkSj okil Disk ij Write djrs gSaA “C” esa Local Variables Hkh gksrs gSa ysfdu Local
Variables, egRoiw.kZ Data ds fy;s brus mi;ksxh ugha gksrs gSa] tks fd fofHkUu Functions }kjk
Access fd, tkrs gSaA
12
www.BccFalna.com
C++ in Hindi
eku yks fd ,d u, Programmer dks Data dks fdlh [kkl rjhds ls Analyze djus ds fy;s
,d Function fy[kus dks dgk x;kA izksxzke dh xw<rk ls vufHkK Programmer ,d ,slk
Function cukrk gS tks fd vpkud fdlh egRoiw.kZ Data dks u’V dj nsrk gSA ,slk gksuk dkQh
vklku gS D;ksafd dksbZ Hkh Function Data dks Access dj ldrk gS] blfy;s D;ksafd
Procedural Language esa Data Global gksrk gSA ;s dqN ,slk gh gS tSls fd vki vius
Personal dkxtkr dks Telephone Directory ds ikl j[k nsa tgka dHkh Hkh dksbZ Hkh igqap
ldrk gS] mlls NsMNkM dj ldrk gS vkSj mls u’V dj ldrk gSA blh izdkj ls Procedural
Languages esa gksrk gS tgka vkidk Data Global gksrk gS vkSj dksbZ Hkh Function mls Use
djds [kjkc dj ldrk gS ;k uqdlku igqapk ldrk gSA
Procedural Languages dh nwljh deh ;s Fkh fd dbZ Functions ,d lkFk ,d gh Data dks
Use dj jgs gksrs gSa] blfy;s Data dks Store djus dk rjhdk dkQh tfVy gks tkrk gSA leku
Data dks Use dj jgs lHkh Functions dks Modify fd, fcuk Data esa fdlh izdkj dk dksbZ
ifjorZu ugha fd;k tk ldrk gSA mnkgj.k ds fy;s ;fn vki ,d u;k Data Add djrs gSa rks
mu lHkh Functions dks Modify djuk gksxk tks fd Data dks use dj jgs gSa rkfd ;s lHkh
Functions Add fd, x, u, Data dks Use dj ldsaA ;s irk djuk fd dkSu&dkSu ls
Function Data dks Use dj jgs gSa vkSj lHkh dks fcYdqy lgh rjhds ls Modify djuk dkQh
dfBu gksrk gSA
Procedural Programs dks Design djuk dkQh eqf”dy gksrk gSA leL;k ;s gksrh gS fd budk
Design okLrfod thou ls Related ugha gksrk gSA tSls fd] ekuk vki ,d Graphics User
Interface esa Menus Window ds fy;s Code fy[kuk pkgrs gSa] rks vkidks ;s r; djuk eqf”dy
gksxk fd dkSulk Function Use fd;k tk,\ dkSulk Data Structure Use fd;k tk,\ vkfnA
budk dksbZ Li’B mRrj ugha gSA
Procedural Programs ds lkFk dbZ vkSj ijs”kkfu;ka gSaA muesa ls ,d leL;k u, Data Type
dh gSA Computer Languages esa dbZ izdkj ds Built-in Data Types gksrs gSa] tSls fd
Integer, Float, Character vkfnA ekuyks fd vki Complex Numbers ds lkFk izfØ;k djuk
pkgrs gSa ;k Two-dimensional Coordinates ds lkFk dke djuk pkgrs gSa ;k Date ds lkFk
izfØ;k djuk pkgrs gSaA
Built-in Data Type budks vklkuh ls Handle ugha dj ldrs gSaA blfy, gesa gekjh
vko”;drkuqlkj Lo;a ds Data Type cukus dh t:jr gksrh gSA ;kuh Real World Objects dks
Represent djus ds fy, gesa ,d ,sls rjhds dh t:jr gksrh gS] ftlls vklkuh ls Real World
Objects dks Computer esa Represent fd;k tk lds vkSj ftl rjg ls Real World esa
fofHkUu Objects vkil esa Interaction djds fdlh leL;k dk ,d mfpr lek/kku izkIr djrs gSa]
mlh rjg ls Computer esa Hkh fdlh leL;k dk lek/kku izkIr fd;k tk ldsA
13
www.BccFalna.com
C++ in Hindi
Procedural Language esa Lo;a ds Data Type cuk dj ge mUgs fcYdqy Built-in Data Type
dh rjg Use ugha dj ldrs gSaA Procedural Language brus mUur ugha gSaA tfVy rjhdksa
dks viuk, fcuk ge Procedural Languages esa x o y nksuksa Coordinates dks ,d gh
Variable esa Store djds ml ij Processing ugha dj ldrs gSaA Procedural Languages
dks fy[kuk o Maintain djuk dkQh eqf”dy dke gksrk gSA
Lkkjka” k
• dkeksa dks djus dk egRo Fkk] Data dk ughaA ;kuh Primary Attention Problem dks
Functions esa foHkkftr djus dk Fkk Data dh Security dk ughaA ( Algorithm )
• cMs Program dks NksVs Programs esa foHkkftr fd;k tkrk Fkk] ftUgsa Functions dgrs gSaA
T;knkrj Functions Global Data dks Share djrs Fks] ftlls Data Insecure gks tkrk FkkA
• Application esa Data dk dkQh vklkuh ls fofHkUu Functions ds chp Transaction gksrk FkkA
fofHkUu Functions Data dks fofHkUu Forms esa Transform djrs FksA
• Top-Down Approach dks Support djrs FksA
D;ksafd ;s fdlh Object ds fdlh veqd Class ls lEcaf/kr gksrs gSa] tks fd fdlh Data dks
Access djus dk ,d ek= ek/;e gksrs gSaA ;fn vki fdlh Object ds vUnj j[ks fdlh Data
dks Read djuk pkgrs gSa] rks vkidks blh Object ds vUnj fy[ks ml Member Function dks
Call djuk iMrk gS] ftls ml Object ds Data dks Use djus ds fy;s gh fy[kk x;k gSA ;gh
,d Function gksrk gS] ftldh enn ls vki ml Object ds Data dks Read dj ldrs gSaA
vki lh/ks gh Data ds lkFk fdlh izdkj dh izfØ;k ugha dj ldrs gSa] D;ksafd Data Hidden
jgrk gSA blfy;s fdlh izdkj ls vpkud gq, ifjorZu ls Data lqjf{kr jgrk gSA
Data o Data dks Use dj ldus okys Function dk ,d lkFk ,d gh Unit ds :i esa gksuk
Encapsulation dgykrk gSA Data dk Hidden jguk ;kuh Data Hiding o
Encapsulation Object Oriented Programming dk ewy rF; ;k Key terms gSA ;fn
vki fdlh Data dks Modify djuk pkgrs gSa] rks vkidks irk gksuk pkfg, fd dkSulk Function
ml Data ij dke djsxk ;kuh Object dk og Member Function ftls Data ds lkFk fy[kk
x;k gSA dksbZ Hkh vU; Function ml Data dks Access ugha dj ldrk gSA ;s Processing
Program dks fy[kuk] Debug djuk o Maintain djuk vklku cukrh gSA ,d “C++” dk
14
www.BccFalna.com
C++ in Hindi
izksxzke <sj lkjs fofHkUu izdkj ds Objects dk cuk gksrk gS] tks fd vius&vius Member
Functions ds }kjk vkil esa Communication djrs gSaA “C++” o dbZ vU; OOP Languages
esa Member Functions dks Methods dgk tkrk gS vkSj Data Item dks Instance Variable
dgk tkrk gSA fdlh Object ds Member Function dks Call djuk ml Object dks
Message Send djuk dgykrk gSA
ge ,d mnkgj.k ysrs gSaA ekuk ,d cMk izhfr&Hkkst (Party) dk lekjksg gS] ftlesa lHkh esgeku
fdlh Dining Table ds pkjksa vksj cSBs gSaA fdlh Table ds pkjksa vksj cSBs yksxksa dks ge
Functions eku ldrs gSa tks fd [kkuk [kkus dk dke djrs gSa vkSj tks Hkh [kkuk Table ij j[kk
gS] mls Data dg ldrs gSaA tc Hkh fdlh dks Table ij j[ks fofHkUu izdkj ds O;atuksa esa ls dqN
ysuk gksrk gS] rks og Lo;a gh ml O;atu rd igqaprk gS vkSj mls mi;ksx esa ys ysrk gS fdlh
iMkSlh esgeku ls dksbZ Hkh O;atu Pass djus dks ugha dgrkA Procedural Program dk Hkh ;gh
rjhdk gksrk gSA
;s rjhdk rc rd cgqr Bhd gS tc rd fd [kkuk [kkus okys esgekuksa dh la[;k lhfer gks ;kuh
N% ls vkB yksx vyx&vyx lewg esa vyx&vyx Table ij [kkuk [kk jgs gSaA ysfdu ;fn
esgekuksa dh la[;k chl ;k blls Hkh vf/kd gks rks ;s rjhdk Bhd ugha dgk tk ldrk gSA
D;ksafd tc esgeku vf/kd gksaxs rks Table Hkh cMk gksxk vkSj [kkus ds fofHkUu lkeku iwjs Table ij
dkQh nwj&nwj gksaxsA ,sls esa ;fn dksbZ esgeku fdlh nwj j[ks O;atu rd igqapuk pkgrk gS rks gks
ldrk gS fd mlds Shirt dh Sleeves fdlh nwljs esgeku ds [kkus esa pyh tk, ;k dbZ esgeku
,d lkFk fdlh O;atu ij gkFk c<k,a vkSj O;atu Table ij fxj dj [kjkc gks tk,A ;kuh ;fn
esgekuksa dh la[;k dkQh T;knk gks rks ,d gh Table ij Hkkstu djuk ,d ijs”kkuh okyk dke
gksxkA ,d cMs Procedural Program esa Hkh ;gh gksrk gSA
bl leL;k ds lek/kku ds :i esa ;fn dbZ NksVs&NksVs Tables gksa vkSj mu ij ,d lhfer ek=k
esa esgeku gksa vkSj lcds ikl mudk viuk Hkkstu gks rks ;s ,d vPNh O;oLFkk gks ldrh gSA bl
NksVs Table ij lHkh esgeku fdlh Hkh O;atu ij vklkuh ls igqap ldrs gSa vkSj fdlh izdkj dh
ijs”kkuh Create ugha gksrh gSA ;fn dksbZ esgeku fdlh vU; Table ij j[ks fdlh O;atu dks ysuk
pkgrk gS rks lEHkor;k og fdlh vU; esgeku ls ml O;atu dks ykus ds fy;s dg ldrk gSA ;s
rjhdk Object Oriented Programming dk gS ftlesa gjsd NksVh Table dks ,d Object dgk
tk ldrk gSA
gjsd Object esa mldk Lo;a dk Data vkSj Function gksrk gS mlh izzdkj ls ftl izdkj ls gjsd
Table ij vyx & vyx esgeku gksrs gSa vkSj gjsd Table ij viuk vyx [kkuk gksrk gSA Data
o Function ds chp gksus okys fofHkUu ysu&nsu vf/kdrj Object ds vUnj gh gksrs gSa ysfdu
vko”;drkuqlkj ;s Hkh lEHko gS fd fdlh vU; Object ds Data dks Hkh Use fd;k tk ldsA bl
rjg ls fdlh cMs Procedural Program dks NksVs&NksVs Object ds :i esa O;ofLFkr djds
T;knk vPNh rjg ls Program dks Maintain fd;k tk ldrk gSA
15
www.BccFalna.com
C++ in Hindi
1 Physical Objects
fdlh Lift ls lEcaf/kr izksxzke ftlesa Program dk ewy fcUnq Lift ij fuHkZj djrk gS]
blesa Lift dks ,d Object dgk tk ldrk gSA
fdlh vFkZO;oLFkk ls lEcaf/kr izksxzke esa fo”o ds lHkh ns”kksa dks Object ekuk tk ldrk
gSA D;ksafd bl izksxzke dk ewy fcUnq fofHkUu ns”k gksaxs] ftudh vFkZO;oLFkk ij lkjk izksxzke
fuHkZj gksxkA
fdlh Traffic Flow ls lEcaf/kr izksxzke esa fofHkUu izdkj ds okgu Objects gks ldrs gSa]
D;ksafd iwjk izksxzke okguksa dks dsUnz esa j[k dj gh Develop fd;k tk,xkA
fdlh Air Traffic ls lEcaf/kr izksxzke esa fofHkUu ns”kksa ds Aircraft Object gksaxsA
2 fdlh Computer User Environment esa dEI;wVj ds fofHkUu vo;o tSls fd Window,
Menu, Graphics Objects ( Line, Rectangle, Circle ) Mouse, Keyboard, Toolbars,
Command Buttons, Disks Drives, Printer vkfn Objects gksrs gSaA
16
www.BccFalna.com
C++ in Hindi
Binary Trees vkfn Objects gksrs gSaA
6 User Defined Data Types esa Time, Complex Numbers, Points Of Planes vkfn
Objects gksaxsA
bu mnkgj.kksa ls ge le> ldrs gSa fd fdlh Program ds fdlh fgLls esa ;k iwjs izksxzke esa tks
ewy oLrq gksrh gS] og Object dgh tk ldrh gSA fdlh Hkh leL;k dks Object ds :i esa
foHkkftr djuk dkQh vklku gSA D;ksafd nqfu;k dh gj oLrq dks t:jr ds vuqlkj ,d Object
ekuk tk ldrk gSA gjsd Object dh viuh {kerk,a gksrh gSa vkSj gjsd Object dqN uk dqN dke
dj ldrk gSA bls le>us ds fy;s ,d mnkgj.k ns[krs gSaA
cMh bekjrksa esa fofHkUu eaftyksa ij vkus&tkus ds fy;s Lifts gksrh gSaA bl Lift dks ,d Object
ekuk tk ldrk gSA ekuk fd pkSFkh eafty ij fdlh Lift esa pkj Passengers gSa vkSj
Passengers us 8th, 10th o 15th eafty ij tkus ds fy;s Button Press fd;k gS] rks Lift esa ;s
{kerk gksrh gS fd ;s uhps tk ldrh gS] Åij tk ldrh gS] ;s blds njoktksa dks [kksy ldrh gS o
cUn dj ldrh gS] ;s irk dj ldrh gS fd nwljh Lifts dkSulh eafty ij gSa vkSj mls vxyh
fdl eafty ij tkuk gSA
“C++” esa ,d Object ds Data ;s /;ku j[krs gSa fd Object esa D;k&D;k {kerk,a gSa vkSj
Object ds Member Functions bl ckr dk /;ku j[krs gSa fd Object mu Data ds lkF k
D;k&D;k dj ldrk gSA bl Lift Object esa fuEu Data gks ldrs gSa%
• Current_floor_number
• Number_of_passengers
• List_of_buttons_pussed
17
www.BccFalna.com
C++ in Hindi
• GoDown()
• GoUp()
• OpenDoors()
• CloseDoors()
• GetInfo()
• CalculateWhereToGo()
Object Oriented Programming esa fdlh oLrq dh fo”ks’krk o oLrq dh {kerk ,d lkFk esa gksrh
gS] Bhd mlh izdkj ls Object Oriented Program esa Data o Functions ,d lkFk esa ,d
Unit ds :i esa gksrs gSa] ftls Object dgk tkrk gSA Object ds Data o mu Data dh State esa
ifjorZu djus okys Functions dks ,d Unit ;k bdkbZ ds :i esa Combine djus dh izfØ;k dks
Encapsulation dgrs gSaA Encapsulation dh izfØ;k ls izkIr gksus okyk Template ;k
Description Class dgykrk gSA
Objects fdlh Object Oriented System dh Basic Run Time Entities gksrs gSaA Objects
Memory esa Space ysrs gSa vkSj gj Object dk ,d Memory Address gksrk gSA tc ge fdlh
Object Oriented Program dks Execute djrs gSa] rc fofHkUu Objects ,d nwljs dks
Message Pass djds ;kuh muds Member Functions dks Call djds ,d nwljs ls
Communication djrs gSaA
mnkgj.k ds fy, eku yks fd “Customer” o “Account” nks Objects gSaA vc ;fn Customer
dks viuk Bank Balance tkuuk gks] rks og Account Object dks ,d Message Pass djrk gS
vkSj vius Bank Balance dh tkudkjh izkIr djus ds fy, Request djrk gSA Account
Object Customer Object dh Request dks iwjk djrk gS vkSj mls Bank Balance dh
tkudkjh iznku dj nsrk gSA bl rjg ls Customer Object fcuk ;s tkus gq, fd Account
Object esa dkSu&dkSu ls Data gSa] vius Balance dh tkudkjh izkIr dj ldrk gSA
viuk Balance tkuus ds fy, Customer Object dks dsoy bruk gh /;ku j[kuk gksrk gS fd
Account Object dks dkSulk Message Pass djus ij ;kuh Account Object ds fdl
Member Function dks Call djus ij Account Object Account Balance dh tkudkjh iznku
djsxkA
Classes
tc gesa ,d gh Data Type ds dbZ Data dks fdlh Variable esa Store djuk gksrk gS] rc ge
Array dk iz;ksx djrs gSa vkSj tc fofHkUu Data Type ds vkil esa Logically Related dbZ
18
www.BccFalna.com
C++ in Hindi
Data dks ,d gh Variable esa j[kuk gksrk gS rc ge Structure dk iz;ksx djrs gSaA “C++” esa
Class Hkh ;gh dke djrk gSA ;kuh Class esa Hkh ge fofHkUu Data Types ds] vkil esa
Logically Related Variables Declare djrs gSaA Structure o Class esa ewyHkwr vUrj ;gh gS
fd ,d Structure ds Members Default :i ls Global ;k Public gksrs gSa tcfd ,d Class
ds Members Local ;k Private gksrs gSaA
,d Class esa Data Nqik gqvk jgrk gS D;ksafd dsoy ml Class ds Objects gh ml Class ds
Data dks Access djus esa l{ke gksrs gSaA fdlh vU; Class ds Objects ;k fdlh External
Functions ds fy, ;s Data Accessible ugha gksrs gSaA bl izfØ;k dks Data Hiding dgrs gSaA
Data o Data dks Access djus ds fy, Authorized Function nksuksa dks ,d Unit ds :i esa
Combined Form esa Describe fd;k tkrk gSA fdlh Object ds Data o Data ij Perform
gksus okys Operations ds Functions dks ,d Unit ds :i esa j[kus dh izfØ;k dks
Encapsulation dgk tkrk gSA fdlh Class ds vUnj Declare fd, x, os Variables ftuesa
Object ds Data Stored jgrs gSa] Data Members dgykrs gSa vkSj mu Data ds lkFk izfØ;k
djus okys Functions Member Functions dgykrs gSaA
fdlh Object ds Data o Data ij Perform gksus okys Operations dks Encapsulate djds ,d
Unit esa j[kus ij Create gksus okys Template ;k Description dks Class dgrs gSaA Class ,d
u, izdkj dk User Defined Data Type gksrk gSA bl Create gksus okyh Class dk ge ftrus
pkgsa mrus Objects Create dj ldrs gSaA ;kuh ,d Class leku izdkj ds Objects ds lewg dh
Description ;k Template dks Represent djrk gSA Classes User Defined Data Type
gksrh gSa vkSj Built-In Data Type dh rjg Behave djrh gSaA
ftl izdkj ls fdlh Structure dks Define djus ds ckn ml Structure ds izdkj ds
Variables Declare fd, tkrs gSa] mlh izdkj ls fdlh Class ds Hkh Variables Declare fd,
tkrs gSa rkfd ml Class ds Data dks Use fd;k tk ldsA “C++” esa Class izdkj ls Declare
fd, x, Variables dks Object dgk tkrk gSA tc dksbZ Class Define dh tkrh gS] rc og
Memory esa dksbZ Space Reserve ugha djrk gSA ,d Class izdkj dk Variable ftls
Object dgrs gSa] Declare djus ds ckn gh og Memory esa vius Class dh {kerk ds vuqlkj
Space Reserve djrk gS] Bhd mlh izdkj ls ftl izdkj ls fdlh Structure dks Define
djus ij og Memory esa dksbZ Space Reserve ugha djrk gSA tc ge Structure izdkj ds
Variable Declare djrs gSa rHkh Memory esa Space Reserve gksrh gSA
19
www.BccFalna.com
C++ in Hindi
Data Hiding, Data Abstraction and Encapsulation
fdlh System dh Inner Working dks Hide djds mls mi;ksx djus ds fy, ,d Well
Defined Interface rS;kj djus dh izfØ;k dks ge Encapsulation dgrs gSaA Create gksus okys
Object dks Real World esa tc Use djuk gksrk gS] rc ge mlh Well Defined Interface }kjk
ml Object ds Data dks Access djrs gSaA
Data o Data ij Perform gksus okys Operations ds Functions dks ,d Unit ds :i esa Bind
djds Object dh Class cukus dh izfØ;k dks Encapsulation dgrs gSaA bl Encapsulation
ds Concept ds vk/kkj ij cuus okyh Class ds Data dks dsoy mlh Class esa Define fd, x,
Member Functions gh Access dj ldrs gSAa
bu Member Functions ds vykok dksbZ Hkh External Function ml Specific Class ds Data
dks Access ugha dj ldrk gSA fdlh Class ds vUnj Define fd, x, Member Function gh
Program o Object ds Data ds chp Interface iznku djrs gSaA fcuk bu Member Function
ds Main Function, fdlh vU; Class esa Define fd;k x;k Member Function ;k dksbZ Hkh
vU; User Defined External Function ml Specific Object ds Data dks Access ugha dj
ldrk gSA ;kuh Main Program ls Object dk Data iwjh rjg ls Insulated ;k vyx gksrk gSA
bl Insulation ds dkj.k fdlh Specific Object dk Data fdlh vU; User Defined External
Function ;k Main Program ls Nqik gqvk jgrk gSA blfy, bl Insulation dh izfØ;k dks
Data Hiding dgrs gSaA
Data Abstraction ,d ,slh izfØ;k gksrh gS] ftlesa fdlh leL;k ls lEcaf/kr t:jh ckrksa dks
fcuk t:jh ckrksa ls vyx fd;k tkrk gSA fQj mu t:jh ckrksa dks leL;k ds fdlh Object dh
Properties ds :i esa Describe fd;k tkrk gSA mnkgj.k ds fy, ekuyks fd fdlh Company
ds Administrator dks viuh Company ds lHkh Employees dh Educational Information dh
tkudkjh j[kuh gSA bl fLFkfr esa fdlh Employee dh fofHkUu Properties fuEukuqlkj gks ldrh
gSa%
20
www.BccFalna.com
C++ in Hindi
• Address of the Employee
• City of the Employee
• State of the Employee
• Country of the Employee
• Date Of Birth of the Employee
• Education Of the Employee
• Hobbies of the Employee
• Experience in the Company of the Employee
• Extra Degree Of the Employee
• Cast of the Employee
• Religion of the Employee
fdlh Employee dh vkSj Hkh cgqr lh fo”ks’krk,a gks ldrh gSa] ysfdu pwafd leL;k esa Company
ds Administrator dks vius Employees dh dsoy Educational Information ls gh eryc gS]
“ks’k Information dk Company ds Administrator ds fy, dksbZ mi;ksx ugha gS] blfy,
Administrator dh leL;k ls lEcaf/kr t:jh ckrsa dsoy fuEukuqlkj gh gSa%
buds vykok ,d Employee dh tks Hkh Information gSa] os bl leL;k ds fy, t:jh ugha gSa]
gkykafd fdlh vU; leL;k ds fy, ;s t:jh gks ldrh gSaA bl rjg ls geus ,d Employee dh
fofHkUu fo”ks’krkvksa esa ls mu fo”ks’krkvksa dks vyx fd;k tks Company ds Administrator ds fy,
t:jh gSa ;k gekjh Current leL;k ls lEcaf/kr gSaA bl izfØ;k dks gh Abstraction dgrs gSa]
ftlesa geus Employee dh mu t:jh ckrksa dks mu fcuk t:jh ckrksa ls vyx fd;k gS] ftudh
Company ds Administrator dks t:jr gSA
fdlh vU; leL;k tSls fd Employees ds Bio Data dks Manage djus okyh Class dks
Create djrs le; ;s lHkh Information t:jh gks ldrh gSaA ml fLFkfr esa dqN vU; ckrsa gksaxh
tks Employee ds Bio Data ls lEcaf/kr ugha gksaxhA rc Hkh gesa Employee ds fofHkUu Data ij
Abstraction dh izfØ;k dks ykxw djds t:jh Data dks fcuk t:jh Data ls vyx djuk gksxkA
tc ge fdlh leL;k ds lek/kku ds fy, fdlh Object dh t:jh ckrksa dks fcuk t:jh ckrksa ls
vyx dj ysrs gSa] ;kuh Object dh fofHkUu Properties ij Data Abstraction dh Process dks
ykxw djus ds ckn tks t:jh Properties izkIr gksrh gSa] mu Properties dks Class ds
Attributes ds :i esa Define dj fy;k tkrk gS vkSj bu Attributes ;k Properties dh State
;k fLFkfr esa ifjorZu djus okys Operations ds Functions dks Attributes ds lkFk ,d Unit ds
:i esa Encapsulate dj fy;k tkrk gS] ftlls ,d Description cu tkrk gSA fQj bl
21
www.BccFalna.com
C++ in Hindi
Description dks ,d uke ns fn;k tkrk gS] tks fd fdlh Class dks Define djrk gS] ;kuh ge
,d ubZ Class cuk ysrs gSaA
pwafd ge tkurs gSa fd Class OOPS esa ,d u, User Defined Data Type dks Represent
djrk gS vkSj ge tks Class cukrs gSa] ml Class esa Abstraction izfØ;k ds ckn izkIr gq,
Attributes gksrs gSa] blfy, bl u, Create gksus okys Data Type dks Abstract Data Type
dgrs gSaA
Inheritance
ftl izdkj ls ge okLrfod thou esa fofHkUu Classes dks Subclasses esa foHkkftr djrs gSa]
Bhd mlh izdkj ls ge “C++” esa Hkh Classes dks fofHkUu Subclasses esa foHkkftr dj ldrs
gSaA tSls tkuojksa ds lewg dks ge ikuh esa jgus okys tkuojksa] ok;q esa mMus okys tkuojksa o /kjrh
ij pyus okys tkuojksa esa ckaV ldrs gSaA fQj gjsd tkuoj dks mldh fo”ks’krkvksa ds vk/kkj ij
vkSj Hkkxksa esa foHkkftr dj ldrs gSaA Bhd blh izdkj ls ge “C++” esa Hkh Classes dk foHkktu
dj ldrs gSa] tks fd fiNyh Classes dh fo”ks’krkvksa ds lkFk viuh Hkh dqN vU; fo”ks’krkvksa dks
mi;ksx esa ysrk gSaA ;s izfØ;k OOPS esa Inheritance dgykrh gSA
tks eq[; Class gksrh gS] mls Base Class dgrs gSa vkSj bldh viuh fo”ks’krk,a gksrh gSaA bl
Class ds vUnj vkSj foHkktu fd;k tk, rks og foHkkftr Class Derived Class dgykrh gS]
ftlesa mldh Base Class ds xq.k rks gksrs gh gSa] lkFk gh blds vius Hkh dqN vyx xq.k gksrs gSa
tks fd Base Class esa ugha gksrsA
Inheritance ,d ,slk rjhdk gS ftlls ,d Class ds Objects fdlh nwljh Class ds xq.kksa dks
izkIr dj ysrs gSaA ;s Hierarchical Classification dks Support djrk gSA OOPS esa
Inheritance dk ;s Concept Reusability dk Idea Provide djrk gSA bl Concept ds vk/kkj
ij ,d igys ls cuh gqbZ Class ds xq.kksa dks Derive djds ubZ Class cukbZ tkrh gSA
Reusability
,d ckj ,d Class fy[k dj rS;kj dj ysus ds ckn ge mlh Class dks dbZ vU; izksxzkeksa esa
vko”;drkuqlkj mlh izdkj ls Use dj ldrs gSa ftl izdkj ls Procedural Languages esa
Library Functions dks Use djrs gSaA Inheritance dh fo”ks’krk dks Use djrs gq, ge ,slk Hkh
dj ldrs gSa fd fdlh igys ls cukbZ xbZ Class esa ifjorZu fd;s fcuk gh ge mlesa ,d
Derived Class cukdj Base Class ds xq.k Hkh Use dj ysa vkSj viuh Derived Class ds
xq.k Hkh mlesa tksM ldrs gSaA
22
www.BccFalna.com
C++ in Hindi
tSls fd ekuk vkius ,d Class cuk;k tks fd Menu cukus dk dke djrk gSA vki bl Class
esa ifjorZu djuk ugha pkgrs gSa] ysfdu vki pkgrs gSa fd mlesa Animation dh Capability Hkh vk
tk,A ,sls esa vki ,d ubZ Class cuk ldrs gSa] ftlesa Base Class ds lkjs xq.k rks gksaxs gh
lkFk esa vki Animation dk xq.k Hkh mlesa tksM ldrs gSaA bl rjg ls OOPS dh otg ls vki
fdlh Class dks ckj&ckj fy[kus ls cp tkrs gSa vkSj ,d gh Class dks dbZ txg Use dj
ldrs gSaA ;s Hkh OOPS dh ,d [kkl fo”ks’krk gSA
struct Add
{
int num1;
int num2;
};
struct Add A, B, C ;
;fn ge C = A + B ; djsa] rks ;s ,d xyr Statement gksxkA fdlh Class ds Objects dks
Hkh ge Bhd blh izdkj ls ugha tksM ldrs gSa] D;ksafd Class Structure dk gh Modified :i
gSA
bldk dkj.k ;s gS fd Compiler ;s ugha tkurk gS fd User }kjk Define fd, x, Variables
ds lkFk fdl izdkj ls tksM fd;k tk,A tcfd Built-in Data Types esa tksM djus ds bl rjhds
23
www.BccFalna.com
C++ in Hindi
dks Compiler esa igys ls gh fuf”pr dj fn;k x;k gS vkSj + Operator ;s tkurk gS fd bu
Variables dks dSls tksMk tk,A
blfy;s User Defined Data Type ds Variables ;k Object dks tksMus dk rjhdk
Operators dks crkuk iMrk gSA ;kuh + Operators dks ;s crkuk iMrk gS fd fdl izdkj ls
User Defined Data Type ds Variables ;k Objects dks ;s Operator tksMsxkA
blds fy;s gesa u, izdkj ds Operations Define djus gksrs gSaA bl izdkj ls Operators o
Functions dks vyx&vyx rjhds ls bl ckr ij fuHkZj djrs gq, fd os fdl izdkj ds Data ij
Operation dj jgs gSa] Use fd;k tkrk gS vkSj bl izfØ;k dks Polymorphism dgk tkrk gSA
fdlh Existing Operator tSls fd +, = vkfn dks bl yk;d cuk;k tkrk gS fd os User
Defined Data Type ds fofHkUu izdkj ds Variables ;k Objects ij fØ;k dj ldsaA fofHkUu
Operators dks bl yk;d cukus dh fØ;k dks Operators dh Overloading djuk dgk tkrk
gSA
tc dbZ Functions ds uke leku gksrs gSa ysfdu muds Arguments ;k Parameters dh la[;k
;k Return Data Type ;k fQj Formal Arguments ds Data Type esa vkil esa vUrj gksrk
gS] rks bls Functions dh Overloading gksuk dgk tkrk gSA Overloading ls ,d
Programmer ds fy, Program fy[kuk o le>uk vklku gks tkrk gSA ;g Hkh
Polymorphism dk ,d rjhdk gSA
Dynamic Binding
fdlh Object ds Reference esa dkSulk Function Call gksuk pkfg,] tc ;s ckr Program ds
Compile Time esa r; gksrh gS] rks bls Early Binding dgrs gSaA tcfd fdlh Object ds
Reference esa fdlh dke ds fy, dkSulk Procedure Execute gksxk] ;s ckr tc Program ds
Runtime esa r; gksrh gS] rc bls Late Binding ;k Dynamic Binding dgrs gSaA
Polymorphism ds vUrxZr Dynamic Binding dk dke gksrk gSA bls le>us ds fy, fuEu fp=
nsf[k,%
bl fp= esa ge ns[k ldrs gSa fd Shape Class ,d Base Class gS ftls Inherit djds rhu
ubZ Classes Circle, Box o Triangle dks Create fd;k x;k gSA pwafd ;s rhuksa gh Classes
Shape Class ls Inherited gSa] blfy, Base Class Shape dk Draw() Method rhuksa gh
Classes esa Inherited gSA
vc ekuyks fd geus rhuksa Derived Classes dk ,d&,d Object Create fd;k vkSj ml
Object dks Draw djus ds fy, Draw() Method dks Call fd;kA ,sls esa tc ge Circle
24
www.BccFalna.com
C++ in Hindi
Class ds Object ds fy, Draw Method Call djrs gSa] rc Compiler Circle Class ds Draw
Method dks Call djds Circle Draw djrk gSA
tc ge Box Object Draw djus ds fy, Box Class ds Object ds Reference esa Draw()
Method dks Call djrs gSa] rc Compiler Box Class ds Draw Method dks Execute djrk
gSA blh rjg ls tc ge Triangle Class dk Object Create djuk pkgrs gSa] rc Compiler
Triangle Class ds Draw Method dks Execute djds Triangle Draw dj nsrk gSA ;kuh ,d
gh uke dk Draw Method Create gks jgs Object dh Class ds vk/kkj ij mlh Class ds
Draw Method dks Execute djrk gS] ftl Class dk Object Create fd;k tk jgk gSA
bl izfØ;k dks Binding Object ds lkFk Method dh Binding gksuk dgrs gSaA pwafd fdl
Object ds Reference esa dkSulk Draw Method Call gksxk] bldk fu.kZ; Compiler Program
ds Runtime esa djrk gS] blfy, bl izfØ;k dks Late Binding ;k Dynamic Binding dgrs
gSaA
Message Passing
Object Oriented Program esa Objects dk iwjk ,d lewg gksrk gSA ;s Objects vkil esa
Communication djrs gSaA fdlh Object Oriented Programming esa fuEu rhu Concepts
gksrs gSa%
• Abstract Data ds vk/kkj ij ,d ,slh Class Definition Create djuk tks Required
Object dh Properties o mlds Behaviors dks Describe djsA
• Create fd, x, Abstract Data Type ;k Class ds Objects Create djukA
• Create gksus okys fofHkUu Objects ds chp Communication dks Establish djukA
nks Objects vkil esa mlh izdkj ls Information Hkst dj o izkIr djds Communication djrs
gSa] ftl rjg ls Real World esa vke yksx vkil esa Message Pass djds Communication
djrs gSaA
25
www.BccFalna.com
C++ in Hindi
• Object
• Message ( Member Function of the object)
• Information (Arguments in the Member Function of the object)
mnkgj.k ds fy, ekuyks fd Customer Object Account Object ls vius Bank Balance dh
tkudkjh izkIr djuk pkgrk gSA ,sls esa Customer Object Account Object dks ,d Message
Hkstrk gS ¼ ;kuh Account Object ds Reference esa fdlh Member Function dks Call djrk
gSA ½ vkSj Message esa Bank Balance dh tkudkjh izkIr djus ds fy, Information
(Arguments) Hkstrk gSA ;kuh Customer Object Account Object ls fuEukuqlkj
Communication djrk gS%
Account.Information(Bank_Balance);
tc ge bl izdkj ls Account Object ls Bank Balance Return djokrs gSa] rks ml Bank
Balance dks Customer Object ds fy, Use dj ldrs gSaA bl izdkj ls ,d Object
(Customer) nwljs Object (Account) ls Communication djus ds fy, nwljs Object ds fdlh
Appropriate Member Function dks Call djrs gq, mls Message Hkstrk gS] rFkk fdlh
tkudkjh ds fy, Arguments ds :i esa Request djrk gSA nwljk Object ml Request dks
Message }kjk izkIr djrk gS vkSj Appropriate Member Function ds Execution }kjk igys
Object dks mldh Required Information iznku dj nsrk gSA
OOPS ,d ,slk Concept gS] ftlds vk/kkj ij ge fdlh leL;k dks Design djrs le; mls
fofHkUu izdkj ds Physical Objects ds :i esa ifjHkkf’kr djrs gSa vkSj bu fofHkUu izdkj ds
Physical Objects dks Computer esa fdlh Hkh Programming Language esa Logically
Represent dj ldrs gSaA fofHkUu izdkj ds Objects dks ftl Programming Language esa
vPNh rjg ls Represent fd;k tk ldrk gS] ml Programming Language dks ge Object
Oriented Programming Language dg ldrs gSaA
“C++” ,d ,slh gh Programming Language gS] tks OOPS ds lHkh Concept dks Computer
esa Implement djus esa l{ke gSA ;fn ge Object dks ljy :i esa ifjHkkf’kr djsa] rks ge ;s dg
26
www.BccFalna.com
C++ in Hindi
ldrs gSa fd Object ,d ,slk Variable gksrk gS] ftlesa ,d ls T;knk izdkj ds “Basic Data
Type” ds ekuksa dks Store o Manipulate fd;k tkrk gSA
;s r; djus ds fy, fd Object fdl izdkj ds vkSj fdrus ekuksa dks Manipulate djus dk dke
djsxk ;k Object fdl Physical Real World Object dks Logically Computer esa Represent
djsxk] gesa ,d Specification (Modal) cukuk gksrk gSA ;s Specification ;k Modal tks fd
Object dh fo”ks’krkvksa ;k Attributes (Data Members) vkSj mu fo”ks’krkvksa (Data Members
dh States) esa ifjorZu djus okys Object ds Behaviors (Member Functions) dks
Represent djrk gSA
bl Specification dks gh Class dgrs gSa] tks fd ,d rjQ rks fdlh Real World Object dks
Computer esa Logically Represent dj jgk gksrk gS vkSj nwljh rjQ ogh Class fdlh Object
dk ,d ,slk Specification gksrk gS] tks Programming Language esa ml Real World Object
dks Logically ,d u, Data Type ds :i esa Represent dj jgk gksrk gSA
lkjka” k
• leL;k esa Procedures ds ctk, Data dk egRo gSA ;kuh OOPS esa Data dks
Primary Level ij j[kk x;k gS vkSj Data ij Perform gksus okys Operations ds
Functions dks Secondary Level ij j[kk x;k gSA
• Problem dks Functions esa foHkkftr djus ds ctk; Objects esa foHkkftr fd;k tkrk
gSA
• Data Structure dks bl izdkj ls Design fd;k x;k gS] tks fd Object dks
Characterize djrs gSaA
• Data ij Perform gksus okys Operations okys Functions dks Object ds Data
Structure ds lkFk gh Combined dj fn;k x;k gS] ftls Encapsulation dgrs gSaA
• Data dks dsoy Data ds lkFk Associate fd, x, Functions gh Access dj ldrs
gSa] ftlls Data External Functions ds fy, Hidden jgrk gSA bl izfØ;k dks
OOPS esa Data Hiding dgrs gSaA
• Objects vkil esa Functions }kjk Communication djrs gSaA bl izfØ;k dks
Message Passing djuk dgrs gSaA
• vko”;drk gksus ij Object esa u, Data o Data ij Perform gksus okys Operations
dks Add fd;k tk ldrk gSA bl izfØ;k dks OOPS esa Inheritance dgrs gSaA
• Program Design esa OOPS ds Approach dks Bottom-Up Approach dgrs gSaA
27
www.BccFalna.com
C++ in Hindi
Benefits Of OOPS
OOPS Program Designer o Program User nksuksa ds fy, dbZ lqfo/kk,a iznku djrk gSA OOPS }kjk
Develop fd, tkus okys Programs esa fuEu fo”ks’krk,a gksrh gSa%
tcfd “C++” tSlh OOPS dks /;ku esa j[k dj Design fd, x, Compiler dks Use djus ij
gesa bl izdkj dh leL;kvksa dk lkeuk ugha djuk iMrkA OOPS dks Implement djus ds lEca/k
esa Hkh ge Programming Languages dks nks Hkkxksa esa ckaV ldrs gSa%
28
www.BccFalna.com
C++ in Hindi
Object-Based Programming Language
Microsoft Company dk Visual – Basic ,d Object Based Programming Language
gSA bl izdkj dh Programming Languages Encapsulations o Object Identity dks
Support djrk gSA Object Based Programming Languages ds eq[; Features
Encapsulation, Data Hiding o Access Mechanism, Objects dk Automatically
Initialize o Clear gksuk rFkk Operator Overloading gksrs gSaA Object-Based
Programming Languages Inheritance o Dynamic Binding dks Support ugha djrs gSaA
os Languages tks Objects dks Use djrs gq, Programming lEHko cukrh gSa] Object –
Based Programming Languages dgykrh gSaA
29
www.BccFalna.com
C++ in Hindi
OOPS
with
C++
30
www.BccFalna.com
C++ in Hindi
OOPS with C++
Object Oriented Programming Concept dks le>s fcuk ge “C++” dh Capabilities dk
iwjk Qk;nk ugha mBk ldrs gSaA Class “C++” dk lcls t:jh Concept gSA Object Oriented
Programming dk Concept le>s fcuk ge dksbZ Serious Program ugha cuk ldrs gSaA
blfy, Class dks le>uk “C++” dks le>us ds fy, lcls t:jh gSA Object Oriented
Concept dks “C++” ds lkFk Use djrs gq, OOPS dks le>kuk dkQh tfVy dke gSA O
bject Oriented Technology dk lkj ;gh gS fd Programmers vius Program mlh izdkj
ls Design dj ldsa ftl rjg ls Real World esa fdlh dke ;k leL;k dks Design fd;k
tkrk gSA ge ;gka ij igys ;gh le>saxs fd Object Oriented Design D;k gksrk gS vkSj fdl
izdkj ls fdlh leL;k dks Object Oriented Form esa Design djds Computer ij ml
leL;k dk lek/kku izkIr fd;k tkrk gSA Object Oriented Programming Concept dk eq[;
vk/kkj Object o Class gSaA
;fn ,d mnkgj.k ns[ksa rks Computer ,d Object gSA ysfdu ;s Computer Lo;a dbZ vU; NksVs
Objects tSls fd Motherboard, Processor, RAM, Hard Disk, Floppy Drive, Cabinet,
SMPS, Monitor, Keyboard, Mouse vkfn ls feydj cuk gksrk gSA
ge Real World esa Hkh ns[krs gSa fd dbZ Objects ds Features leku gksrs gSaA tSls fd ftrus
Hkh Computers gksrs gSa] mu lHkh esa Motherboard gksrk gS] Processor gksrk gS] Hard Disk
gksrh gS] RAM gksrh gS] CD ROM gksrk gS] vkfnA ;kuh gj Computer ds Basic Features ;k
vk/kkjHkwr vo;o leku gksrs gSaA bu lHkh Objects ds pkfjf=d xq.kksa ;k Characteristics esa
le:irk gSA blfy, ,d Computer fdlh Computer Class dk ,d Instance ;k Object
gksrk gSA
Class ,d ,slk Modal, Design ;k Description gksrk gS] ftlds vk/kkj ij leku
Characteristics okys dbZ Object Create fd, tk ldrs gSaA ;kuh ;fn nwljs “kCnksa esa dgsa rks
Class ,d ,slk Modal, Design ;k Description gksrk gS] tks fdlh ,d veqd (Particular)
lewg ds Objects (Entity Set) dh fo”ks’krkvksa (Characteristics) ;k Features dks
Represent djrk gSA
31
www.BccFalna.com
C++ in Hindi
tc ge fdlh Object Oriented Programming Language esa Program fy[krs gSa] rks
Programming ds le; ge fdlh Object dks Define ugha djrs gSa] cfYd ge ml Object dh
fo”ks’krkvksa dk ,d Modal cuk ysrs gSa] ftls Class dgrs gSa vkSj ml Modal (Class) ds vk/kkj
ij vko”;drkuqlkj dbZ Objects Create dj ysrs gSaA bls ,d mnkgj.k }kjk le>us dh dksf”k”k
djrs gSaA
ekuyks fd ;fn vkils dgk tk, fd ,d Car dh ifjHkk’kk nhft,A ifjHkk’kk ds :i esa vki D;k
dgsax\s vki Car dh ,slh fo”ks’krkvksa (Characteristics) dk o.kZu (Description) djsaxs tks
mls nqfu;k dh nwljh phtksa (Objects) ls vyx cukrh gSA vki dg ldrs gSa fd Car ,d ,slh
pht gksrh gS ftlds pkj Wheels gksrs gSaA mlesa cSBus ds fy, dqN lhVsa gksrh gSaA Car esa ,d
Engine gksrk gSA ;s Engine Diesel ls pyrk gSA blesa xfr dks izHkkfor djus ds fy, ,d
Accelerator vkSj ,d Gear Box gksrk gSA blh rjg ls dbZ vkSj fo”ks’krk,a crkbZ tk ldrh gSa]
ftuls ,d Car dh igpku gks ldrh gSA
vkius ,d Car dh tks ifjHkk’kk crkbZ gS] D;k og ifjHkk’kk dkj gSA ugha! ;s ifjHkk’kk dkj ugha gS
cfYd ;s ifjHkk’kk rks Car dk ,d fooj.k ;k Description ek= gSA
ekuyks fd vkidks fdlh Automobile Company ls ;s Offer vkrk gS fd vki ftl rjg dh
Car pkgrs gSa] Company ml rjg dh Car cukus ds fy, rS;kj gSA vki ftl rjg dh pkgsaxs]
ml rjg dh Car cu tk,xhA vc vkidks Company dks crkuk gS fd vkidks fdl rjg dh
Car ilUn gSA lh/kh lh ckr gS fd Company ds Engineers vkidh dYiukvksa okyh Logical
Car dks rHkh lkdkj :i dh Physical Car esa cny ldrs gSa] tc vki fdlh rjhds ls mu
Engineers dks viuh ml liuksa okyh Logical dkj dk fooj.k ns ik,saA ekuyks fd vki viuh
Car esa fuEu fo”ks’krk,a (Characteristics) ;k Features pkgrs gSa%
32
www.BccFalna.com
C++ in Hindi
oxsjg] oxsjgA dYiukvksa dh deh ugha gksrh gS] blfy, ,slh gtkjksa [kwfc;ksa okyh Car dh vki
dYiuk dj ldrs gSaA
;s rks vkius viuh liuksa okyh Logical Car dk Description ns fn;kA ysfdu dbZ LFkkuksa ij
,slh t:jr Hkh iM ldrh gS tc vki viuh ckr dks dsoy Description ls ugha le>k ldrsA
ml fLFkfr esa vki D;k djsaxsA vki ekusa ;k uk ekus] vki isu vkSj dkxt mBk,axs vkSj Lo;a viuh
Car dk ,d iw.kZ lUrqf’Vnk;d Modal ;k Design cuk,axsA D;k ;s Modal vkidh Car gS\
D;k vki bl Modal dks pyk ldrs gSa\
ugha! ;s okLrfod dkj ugha gS cfYd ,d Logical Car ;k Car dk Modal ek= gSA ysfdu ;s
Modal Qkyrw ugha gS cfYd ;s Modal gh lcls egRoiw.kZ pht gSA ,d ckj bl Modal ds cu
tkus ds ckn Company ds Engineers vkidh Logical Car dks ,d Physical Car esa cny
ldrs gSa vkSj vkids liuksa okyh Car dks ,d Physical Modal dk :i ns ldrs gSaA
ekuyks fd Company ds Engineers us vkidh Car cuk nh vkSj og Car fcYdqy oSlh gh gS
tSlh vki pkgrs FksA vc ;fn Company fcYdqy mlh rjg dh ,d vkSj Car cukuk pkgs] rks
D;k Company dks “kq: ls okil lkjk dke djuk iMsxkA D;k mls nqckjk vkils Modal cuokuk
iMsxkA
ugha! Modal dsoy ,d gh ckj curk gS] ysfdu ml Modal ds vk/kkj ij gtkjksa dkjsa cu ldrh
gSa vkSj ftl Modal ds vk/kkj ij gtkjksa Cars cu jgh gSa] ge le> ldrs gSa fd tc rd
Modal Change ugha fd;k tk,xk] rc rd cuus okyh lHkh dkjksa dh lHkh [kwfc;ka ,d leku
gksaxhA fdlh Hkh Car ds fdlh Hkh Feature ;k Characteristic esa fdlh izdkj dk dksbZ vUrj
ugha gksxkA
tks Logical Modal vkius cuk;k gS] og Object Oriented Programming Language esa ,d
Class dks Represent djrk gS vkSj ml Modal ds vk/kkj ij Company ds Engineers us
tks Physical Car cukbZ gS] og Car ,d Physical Object dks Represent djrk gSA ;s
Physical Car vkids }kjk cuk, x, Modal (Class) dk ,d mnkgj.k (Instance) ek= gS]
D;ksafd ;fn Company pkgs rks mlh Modal ds vk/kkj ij dbZ vU; Cars cuk ldrh gSA
ftl rjg ls ,d Modal ds vk/kkj ij ;fn Company pkgs rks gtkjksa dkjsa cuk ldrh gS] mlh
rjg ls ,d Object Oriented Programming Language esa ,d ckj ,d Class Design dj
ysus ds ckn ,d Programmer ml Class ds ftrus pkgs mrus Instance Create dj ldrk
gSA
“C++” esa Class Create djus ds fy, class Keyword dk iz;ksx djuk iMrk gSA okLro esa
Class ,d u, izdkj dk User Defined Data Type gksrk gSA ;s ,d ,slk Data Type gksrk
33
www.BccFalna.com
C++ in Hindi
gS] ftls Programmer Real World ds Physical Objects dks Computer Software ;k
Program ds Logical World ds Object ds :i esa Represent djrk gSA
ge ,d vkSj mnkgj.k ysrs gSaA fiNys mnkgj.k esa geus ,d Modal ds vk/kkj ij Object cuk;k
FkkA bl mnkgj.k esa ge ,d Real World Object ds vk/kkj ij vius Computer Program ds
fy, ,d Logical Class cuk jgs gSaA ,d Real World Object ds vk/kkj ij ml Object dh
Logical Class cukus ds ckn] ml Class ds vk/kkj ij ge ftrus pkgsa mrus Objects cuk
ldrs gSa] D;ksafd ,d Object ds Description ds fo”ys’k.k ls gesa Car dk Modal (Class) fey
tk,xkA
ekuyks fd gesa ,d Physical Car Object dks Computer esa ,d Logical Car ds :i esa
Represent djuk gSA vc Physical dkj dh ,slh D;k fo”ks’krk,a gSa] tks mls fdlh nwljs Real
World Object ls vyx cukrh gSa] mu Characteristics dks fuEukuqlkj fy[kk tk ldrk gSA
;kuh
blh rjg ls ge dqN vkSj fo”ks’krk,a Hkh crk ldrs gSa] tks fdlh Car dks ifjHkkf’kr djrh gSaA
fdlh ,d Car ds vk/kkj ij ge Car dh bruh fo”ks’krk,a izkIr dj ldrs gSaA bu lHkh
Descriptions dks fuEukuqlkj Hkh fy[kk tk ldrk gS%
34
www.BccFalna.com
C++ in Hindi
colorOfCar
sizeOfCar
noOfSeatsInCar
noOfGearsInCar
pickupRateOfCar
maximumSpeedOfCar
noOfWheelsInCar
;fn ge pkgsa rks bu Features esa fuEukuqlkj fofHkUu izdkj ds eku Hkh Fill dj ldrs gSa%
;fn ge FkksMk /;ku nsa rks le> ldrs gSa] fd ;s dqN ,slh Common fo”ks’krk,a ;k dqN ,sls
Common Features (Characteristics) gSa] tks yxHkx lHkh izdkj dh dkjksa ds Features dks
Represent dj ldrs gSaA mnkgj.k ds fy, geus Åij Maruti800 ds fofHkUu Features ds
ekuksa dks ns[kkA vc fuEukuqlkj Features ds ekuksa esa ifjorZu djus ij ge bUgh Features ds
vk/kkj ij Tata Indica ;k Tata Sumo dks Hkh Computer esa Logically Represent dj ldrs
gSaA ;kuh
35
www.BccFalna.com
C++ in Hindi
colorOfCar = Silver
sizeOfCar = 4.25ft
noOfSeatsInCar = 5
noOfGearsInCar = 5
pickupRateOfCar = 80KMPH After 4 Seconds
maximumSpeedOfCar = 160KMPH
noOfWheelsInCar = 4
ge ns[k ldrs gSa fd Car ds dsoy ,d Physical Modal ds vk/kkj ij geus Computer esa ,d
Logical Modal cuk;k vkSj ml Logical Modal dh Description ds vk/kkj ij ge ftruh pkgsa
mruh dkjksa dks Logically Computer esa Represent dj ldrs gSaA bl Description dks gh
Class dgrs gSaA
bl Car Class ds vk/kkj ij ge ftruh Hkh dkjksa dks Computer esa Logically Represent
djsaxs] os lHkh dkjsa blh Car Class ds mnkgj.k (Instance) ;k Objects gksaxs] D;ksafd mu lHkh
dkjksa ds Basic Features ,d leku gksaxs dsoy mu Features ds ekuksa esa gh vUrj gksxkA
geus ;s Description fdlh ,d Car ds vk/kkj ij Develop fd;k Fkk] ysfdu ;s Description
vU; lHkh dkjksa dks Hkh leku izdkj ls Represent dj ldrk gSA Computer esa Hkh ;gh fd;k
tkrk gSA fdlh leL;k ds lcls ewy Object dk irk yxk;k tkrk gSA fQj ml ewy Object ds
vk/kkj ij leL;k ls lEcaf/kr t:jh Features dks ysdj ,d Description rS;kj fd;k tkrk gSA
;fn vkils dgk tk, fd ikap dkjksa ds mnkgj.k nks rks vki Tata Sumo, Tata Indica, Maruti
Zen, Maruti 1000, o Maruti 800 ds mnkgj.k ns ldrs gSaA D;k bu lHkh izdkj dh dkjksa dks
mijksDr Description ds vk/kkj ij Represent ugha fd;k tk ldrk gS\ fuf”pr :i ls fd;k
tk ldrk gS] D;ksafd ;s lHkh Objects leku Class ds mnkgj.k gSaA ;s lHkh ,d Car Class ds
Instances ;k Objects gaS vkSj buds Basic Features leku gSaA
;fn ;gka ge okil ls Class dh ifjHkk’kk dks nksgjk,a rks dg ldrs gSa fd ,d Class leku
Featurs okys Objects ds ,d lewg (Entity Set with Similar Features) dk Logical ;k
Abstract Representation gksrk gS] tcfd ml Class dk dksbZ Instance (mnkgj.k) ml
Class dk Actual Representation ;k Physical Representation gksrk gS ftls Object
dgrs gSaA
36
www.BccFalna.com
C++ in Hindi
1 Attributes
mnkgj.k ds fy, fdlh Objects ds ,d lewg (Entity Set) dks yhft,A vki ns[ksaxs fd mu
lHkh esa dqN ,slh ckrsa gSa] tks lHkh Objects dks leku :i ls izHkkfor djrh gSaA ;s ogh fo”ks’krk,a
gksrh gSa tks fdlh Object dks fdlh nwljs Object ls vyx cukrh gSaA bu fo”ks’krkvksa dks
Attributes dgk tkrk gSA
gj Object fdlh uk fdlh Class dk ,d Instance ;k lnL; gksrk gSA fdlh Entity Set ds ;s
Attributes gh mudh Class ds Features gksrs gSaA tSls ;fn ge ,d Book dks gh ysa rks Book
dh viuh ,d Class gks ldrh gS] ftlls ge nqfu;k dh fdlh Hkh Book dks Describe dj
ldrs gSaA
vc bl Book dh Class ds Features ogh gksaxs tks fdlh ,d Book ds Features gSaA Book
dh ,slh dkSulh Properties gks ldrh gSa] tks ,d Book dks nwljs fdlh Object ls vyx cukrh
gS\a blds loky ds tokc esa ge fdlh Book dks fuEu Properties }kjk ifjHkkf’kr dj ldrs gSa%
blh rjg ls Book dh dbZ vkSj Characteristics gks ldrh gSaA ;s lHkh Characteristics ml
Book Object dh Class ds Features gksrs gSaA bUgha Features dks Book Class ds
Attributes Hkh dg ldrs gSaA ;fn ge bl Book dh Description dks Class ds Modal ds
:i esa Describe djsa rks bl Book Object dh Class dks fuEukuqlkj Represent dj ldrs
gSa%
37
www.BccFalna.com
C++ in Hindi
fdlh Class ds Attributes fdlh Object dh Appearance, State o Condition ds
vk/kkj ij r; gksrs gSaA ;kuh fdlh Class dh Description ds Attributes bl rF; ij vk/kkfjr
gksrs gSa fd ml Class ds Object fdl izdkj ds fn[kkbZ nsrs gSa vkSj muds Objects dh fLFkfr
(Position or Situation) D;k gks ldrh gSA fdlh Object ds bu Appearance o State dh
fofHkUu Description gh ml Object dks nqfu;k ds lHkh Object ls vyx igpku iznku djrh
gSA
mnkgj.k ds fy, bl Book Class dks gh ysrs gSaA ge bl Book Class dk ,d Object
Create djds mlds fofHkUu Attributes dks fuEukuqlkj eku iznku dj ldrs gSa%
;s lHkh Fields Book dh State ;kuh Situation crk jgs gSaA ;kuh Book dk uke “B with
OOPS through C++ In Hindi” gS] tks fd Book dh ,d fLFkfr gSA blh rjg ls Book dh
Price 300 gS] ;s Hkh Book dh fLFkfr dks Represent dj jgk gSA
;fn ge Car dk mnkgj.k ysa] rks Car dk Color o Car dh Size Car ds Appearance dks
Represent djrs gSaA ;kuh ;s crkrs gSa fd Car fn[kkbZ dSlh nsrh gSA tcfd Car dk uke Car
dh State ;k Situation dks Represent djrk gS] tks ;s crkrk gS fd Car dh fLFkfr D;k gS
;kuh Car cukus okyh Company dh Market esa vPNh lk[k gS ;k dksbZ lk/kkj.k Company gSA
Class dh Common Descriptions mldh Class ds lHkh Objects ds fy, leku gksrh gSa vkSj
Object dh ;s Common Descriptions ,d Object dks nqfu;k ds fdlh Hkh vU; Object ls
vyx cukrh gSaA tSls ,d Car vkSj ,d Book nksuksa vyx Object gSaA Car dks Car Class ds
Attributes ls igpkuk tkrk gS tcfd Book dks Book Class ds Attributes lsA Class fdlh
Hkh ,d Object ls nwljs Object dks vyx Represent djus dk ,d Description gksrk gS
tcfd ,d Object dh mlh Class ds nwljs Objects ls vyx igpku Object ds Features ;k
Attributes dks iznku fd, tkus okys eku ij fuHkZj gksrh gSA
;kuh ;fn ,d Book dk uke “C In Hindi” gS vkSj nwljh Book dk uke “OOPS with C++
In Hindi” gS] rks ;s nksuksa gh Books Book Class ds mnkgj.k (Instance) ;k lnL; gSa] ysfdu
38
www.BccFalna.com
C++ in Hindi
nksuksa gh Books vyx Objects dks Represent dj jgs gSa] D;ksafd nksuksa ds bookName
Attribute ds eku ;k Data esa vUrj gSA
Class ,d Derived Data Type gksrk gS] ftls ,d Programmer nqfu;k ds Actual Objects
dks Computer esa Logically Represent djus ds fy, Create djrk gSA fdlh Real World
Problem dks Computer }kjk Solve djus ds fy, gesa gesa”kk ,d ,sls Data Type dh t:jr
gksrh gS] tks Real World Object dks Reflect dj ldsA ;s lqfo/kk “C++” esa gesa Class }kjk
izkIr gksrh gSA
pfy, ,d mnkgj.k }kjk le>us dh dksf”k”k djrs gSa fd ,d Real World Problem }kjk fdl
izdkj ls ,d u, Data Type dks izkIr fd;k tk ldrk gS ftlds vk/kkj ij Computer esa
Logically fdlh Object dks Define o Declare fd;k tk ldrk gSA
Real World esa Hkh Data (eku ;k ekuksa dk lewg [Value or a Set of Values]) dbZ izdkj ds
gksrs gSaA mnkgj.k ds fy, ekuyks fd ,d School dk Principal viuh School ds fofHkUu
Students dh tkudkjh dks Computer ij Maintain djuk pkgrk gSA og pkgrk gS fd mls
tc Hkh t:jr gks] og Computer dk iz;ksx djds viuh School ds fdlh Hkh Student dh
Basic tkudkjh dks izkIr dj ysA ;fn ge fdlh Student dh Basic Information dks ns[ksa rks
fdlh Hkh Student dh fuEu Basic Information gks ldrh gSa] ftUgsa School dk Principal
tkuuk ilUn dj ldrk gS%
Student dk uke
Student ds firk dk uke
Student dk Address
Student dh City
Student dh rglhy
Student dk ftyk
Student dk State
Student dh Class
Student ds Contact Number
Student dh Date of Birth
Student dh School esa Join djus dh Date of Admission
Student dh Age
Student dk Serial Number
Student dh tkfr
;s dqN ,slh tkudkfj;ka gSa] ftUgsa School dk Principal tkuuk ilUn dj ldrk gSA fdlh
Student dh iwjh Information dks bl izdkj ls VqdMksa esa foHkkftr fd;k tk ldrk gS vkSj
39
www.BccFalna.com
C++ in Hindi
tkudkjh ds bu lHkh fgLlksa esa dksbZ eku (Data) Fill fd;k tk ldrk gSA fdlh tkudkjh ds bu
NksVs&NksVs fgLlksa ;k VqdMksa dks Field dgk tkrk gSA tc fofHkUu Fields feyrs gSa rc fdlh ,d
Student ds ckjs esa i;kZIr tkudkjh ;k Information iznku djrs gSaA ;kuh fdlh leL;k ls
lEcaf/kr fofHkUu Fields feydj ml leL;k ds ckjs esa iwjh tkudkjh iznku djrs gSaA bu Fields
ds lewg dks Record dgk tkrk gSA ;kuh gj Student dk ,d iwjk Record gksrk gS ftlesa
mldh tkudkjh ds fofHkUu fgLls Fields ds :i esa gksrs gSaA blh rjg ds dbZ Records dks tc
,d lkFk j[kk tkrk gS] rks ml ,d lkFk j[ks x, fofHkUu Records ds lewg dks File dgk tkrk
gSA
Student dh dqN vkSj Hkh tkudkfj;ka gks ldrh gSa] tks ,d Student dks vU; Student ls
vyx cukrh gSaA tSls Student D;k [kkuk ilUn djrk gS] fdl izdkj ls jguk ilUn djrk gS]
mls dkSulk TV Channel vPNk yxrk gS] vkfnA ysfdu School dk Principal Student dh
bu tkudkfj;ksa dks tkuus esa Interested ugha gSA ;s tkudkfj;ka mlds fy, Qkyrw gSaA ;kuh
dsoy mijksDr tkudkfj;ka School ds Principal ds fy, t:jh gSaA fdlh leL;k dh izd`fr ds
vuqlkj leL;k dh dsoy t:jh ckrksa dks ysuk vkSj fcuk t:jh ckrksa dks NksM nsuk] bl izfØ;k
dks Object Orientation esa Abstraction dgrs gSaA
fdlh Student dh bu lHkh t:jh tkudkfj;ksa dks ;fn eku iznku fd;k tk, rks ge fdlh ,d
Student ds bu Fields dks fuEukuqlkj fofHkUu eku iznku dj ldrs gSa%
ge ns[k ldrs gSa fd ;s lHkh Fields ,d nwljs ls Logically Related gSaA ;fn ge pkgsa rks bls
,d Structure ds :i esa Define dj ldrs gSa vkSj Structure ,d u, izdkj dk User
40
www.BccFalna.com
C++ in Hindi
Defined Data Type gh rks gksrk gSA “C++” esa bl Structure dks gh Modify djds Class ds
:i esa ifjHkkf’kr fd;k x;k gSA blfy, ge blh Description ds vk/kkj ij ,d Class dk
fuekZ.k dj ldrs gSaA
tc fdlh Object dks Computer esa Logically Represent djus ds fy, Class dh
Description ;k Class ds Modal dks dkxt ij rS;kj dj fy;k tkrk gS] rc ml Class dks
Computer esa Programming Language ds vuqlkj Define fd;k tkrk gSA Class dks
Logically Computer esa Define djus ds ckn ml Class ds Objects Create fd, tk ldrs
gSa vkSj muds lkFk mlh izdkj ls dke fd;k tkrk gS] ftl izdkj ls fdlh Real World Object
ds lkFk dke fd;k tkrk gSA ”C++” esa ,d Class dks Define djus dk Format fuEukuqlkj
gksrk gS%
class class_name
{
private:
Data_Members;
Member_Functions;
public:
Data_Members;
Member_Functions;
};
class “C++” dk ,d Keyword gSA fdlh Class dks Computer esa Create djus ds fy, bl
Keyword dk iz;ksx fd;k tkrk gSA bl Keyword ds ckn ,d Programmer dks viuh Class
dk uke nsuk gksrk gSA ;s ogh uke gksrk gS] ftlds vk/kkj ij Programmer vius Program esa
ml Class ds Instances ;k Objects Create djrk gSA
;fn ge gekjh Book o Car Class ds lUnHkZ esa ns[ksa rks ;gka gesa Book ;k Car fy[kuk gksrk
gSA ;s ,d Identifier gksrk gS] blfy, Identifier dks uke nsus ds fy, ftu fu;eksa dk “C” esa
ikyu djuk gksrk gS] mu fu;eksa dk ikyu ;gka Hkh djuk gksrk gSA
;kuh ge dsoy Small o Capital Letters dk iz;ksx ;k Underscore fpUg dk iz;ksx viuh
Class ds uke esa dj ldrs gSaA ;fn gesa vadksa dk iz;ksx djuk gks rks og vad Class ds uke dh
“kq:vkr esa ugha vk ldrkA
41
www.BccFalna.com
C++ in Hindi
,d Student ds Record dks ge Class ds :i esa Describe dj ldrs gSaA mijksDr
Description fdlh Hkh Student ds mu Fields dks Represent djrs gSa] ftudh School ds
Principal dks t:jr gSA ;fn ge bu Description dks lkekU; Fields esa Convert djsa rks gesa
fuEukuqlkj fofHkUu Fields izkIr gksrs gSa] ftudks Combined :i esa ns[kus ij Principal dks
fdlh Student ds ckjs esa os lHkh tkudkfj;ka izkIr gks ldrh gSa] ftUgsa ml School dk
Principal tkuuk pkgrk gS%
1 studentName
2 studentFName
3 studentAddress
4 studentCity
5 studentTehsil
6 studentDistrict
7 studentState
8 studentClass
9 studentContactNumber
10 studentDateOfBirth
11 studentDateOfAdmission
12 studentAge
13 studentSerialNumber
14 studentCast
pwafd Student ,d Real World Object gS vkSj bls Computer esa Logically Represent
djuk gS] blfy, gesa bls Class }kjk Represent djuk gksxkA pwafd Student dh lHkh Basic
tkudkfj;ksa ds Fields ftudh School ds Principal dks t:jr gS] gekjs ikl Student Class
dh Description ds :i esa miyC/k gS] blfy, ge bUgha Attributes dk iz;ksx Student Class
ds fy, dj ldrs gSaA ysfdu blls igys ge fdlh Student ds bu lHkh Fields dks eku iznku
djrs gSaA ;s eku fuEukuqlkj iznku fd, tk ldrs gSa%
42
www.BccFalna.com
C++ in Hindi
9 studentContactNumber = 9352768938
10 studentDateOfBirth = 06/03/1982
11 studentDateOfAdmission = 03/07/1996
12 studentAge = 15
13 studentSerialNumber = 1234545
14 studentCast = Brahmin
ge ns[k ldrs gSa fd ,d Student ds fofHkUu Attributes dks eku ;kuh Data iznku fd;k tk
ldrk gSA pwafd ge tkurs gSa fd Computer esa ekuksa “Values / Set of Values” dks Store
djus ds fy, Variables dk iz;ksx fd;k tkrk gS] blfy, bl Record ds vk/kkj ij ge le>
ldrs gSa fd Student ds gj Attribute dks Computer esa Store djus ds fy, gesa ,d
Variable dh t:jr gksxhA vc Variable fdl Data Type dk gksxk] ;s ge mijksDr Record
esa Fill fd, x, ekuksa ds vk/kkj ij r; dj ldrs gSaA pfy, bl Record ds fofHkUu Attributes
dks Class esa Describe djus ds fy, gj Attribute dk Data Type r; djrs gSaA
gesa”kk Data Type r; djrs le; gesa lcls igys ;s r; djuk gksrk gS fd fdlh Field dk ;k
fdlh Attribute dk eku Numerical gksxk ;k Non-Numerical, ;fn eku Numerical gS] rks
ns[kuk gksrk gS fd ml Numerical Field ds lkFk fdlh izdkj dh izfØ;k gks ldrh gS ;k
gesa ;s
ughaA ;fn izfØ;k gks ldrh gS] rc rks ml Attribute dks mldh Size ds vuqlkj fdlh
Numeric Data Type dk Declare djuk pkfg, vU;Fkk ml Numerical fn[kkbZ nsus okys
Field ;k Attribute dks Hkh String izdkj dk gh Declare djuk pkfg,A pfy,] blh vk/kkj ij
ge Student ds fofHkUu Attributers dk Data Type r; djrs gSaA
pwafd Student dk uke] mlds firk dk uke] Address, tkfr] City, District, rglhy] State,
Class ;s lHkh ,sls Fields gSa] ftuesa Non-Numerical Data Store gksxk] blfy, bu lHkh dks
Character izdkj ds Data Type ds ,d One – Dimensional Array ds :i esa Declare
djuk gksxkA
Admission dh Date, Birth of Date o Age ;s rhuksa ,sls Fields gSa] ftuds lkFk ;s tkuus ds
fy, Processing dh tk ldrh gS] fd dksbZ Student fdrus le; ls School esa gS vkSj fdrus
fnu ls School esa gSA ;s tkudkjh izkIr djus ds fy, Current Date dks Admission Date esa
ls ?kVk;k tk ldrk gSA lkFk gh ;s rhuksa gh iw.kkZad la[;k,a gSa blfy, bl izdkj ds Fields dks
Integer izdkj dk Declare djuk gksxkA
Serial Number, Class o Contact Number ;s rhu Attributes ,sls gSa fd buesa Store rks
la[;k gh gksrh gS] ysfdu bu la[;kvksa ds lkFk fdlh izdkj dh Calculation ugha dh tk ldrh
gS] blfy, ;fn ge pkgsa rks bUgsa String izdkj ds Variable esa Store dj ldrs gSaA
43
www.BccFalna.com
C++ in Hindi
ysfdu String izdkj dk Variable ,d Character dks Store djus ds fy, 1 Byte ysrk gSA
blfy, ;fn 10 vadksa ds Contact Number dks Store djuk gks] rks gesa nl Byte dh
Memory blds fy, Reserve djuh gksxh] tcfd ;fn ge long izdkj dk Variable Declare
djrs gSa] rks ge dsoy 8 Bytes esa gh nl vadksa dh la[;k Store dj ldrs gSaA blfy, ;fn ge
pkgsa rks bUgsa Long izdkj dk Declare dj ldrs gSaA
bl izdkj ls ge Students ds lHkh Attributes ds Data Type r; dj ldrs gSaA Data Type
r; djus ds ckn bu Data Type ds lkFk gesa bu Attributes dks dsoy Class ds Attributes
Section esa fy[kuk gksrk gSA ;kuh ge ,d Student dh Class dks “C++” Language }kjk
fuEukuqlkj Computer esa Logically Describe dj ldrs gSa%
pwafd fdlh Class ds Create gksus okys lHkh Instances ,d vyx Object gksrs gSa vkSj muds
Attributes ds eku Hkh vyx&vyx gksrs gSaA tSls Govind uke ds fdlh Student ds Record
o Shyam uke ds fdlh Student ds Record, bu nksuksa Objects ds Record ds gj Field ;k
Attribute dk eku vyx gksxkA ;s vyx eku Memory esa rHkh Store gks ldrs gSa tc gj
44
www.BccFalna.com
C++ in Hindi
Object ds bu Attributes ds fy, Memory esa vyx Space gksA okLro esa gksrk Hkh ,slk gh
gSA
tSlkfd geus igys Hkh dgk fd Class rks ek= fdlh Object ds Attributes dh ,d
Description gksrh gSA ml Description ds vuqlkj ftrus Hkh Objects curs gSa] mu lHkh
Objects ds gj Attribute dks Store gksus ds fy, ,d vyx Variable feyrk gSA
ge ns[k ldrs gSa fd geus Student ds fofHkUu Attributes dks private: Section esa Declare
fd;k gSA geus ,slk blfy, fd;k gS] rkfd fdlh Object ds Data dks dsoy ogh Object
Access dj ldsA Outer World ds fy, fdlh Object ds fy, ;s Data Hide jgrs gSaA
;s izfØ;k Bhd mlh izdkj dh gS ftl izdkj ls vkids ?kj ds fofHkUu lkekuksa dks dsoy vki gh
mi;ksx esa ys ldrs gSaSA dksbZ vutku O;fDr vkids ?kj esa ?kql dj vkids lkeku dks rc rd
mi;ksx esa ugha ys ldrk tc rd fd vki mls bl ckr dh vuqefr iznku uk djsaA
geus Class rks cuk nh ysfdu ;s Class vHkh iwjh ugha gSA ftl rjg ls gj Object dh dqN
States ;k Situations gksrh gSa] ftuls og Object vU; Objects ls vyx igpku izkIr djrk
gSA blds vykok gj Object fdlh uk fdlh izdkj dk O;ogkj Hkh djrk gSA ;kuh gj Object esa
O;ogkj djus dh Hkh dqN (Abilities) {kerk,a gksrh gSaA
tSls ,d i{kh Class ds Instances dks ns[ksa rks gj i{kh ds ikl ia[k gksrs gSa] gj i{kh ds pksap
gksrh gSA ;s nksuksa Features rks ;s crkrs gSa fd dksbZ i{kh fdl rjg dk fn[krk (Appearance)
gSA blds vykok ,d i{kh dqN dke Hkh dj ldrk gSA ;kuh og nkuk [kk ldrk gS vkSj mM Hkh
ldrk gSA
;kuh gj Object dh viuh dqN fLFkfr;ka (States) gksrh gSa vkSj gj Object dh viuh dqN
{kerk,a (Abilities) gksrh gSaA Object dh mu {kerkvksa ls Object dh States esa ifjorZu gksrk
gSA fdlh Hkh Object dh fLFkfr (State and Appearance) ds eku esa ifjorZu gks ldrk gSA
;fn dkj dk gh mnkgj.k ysa rks dksbZ Car Yellow Color dh Hkh gks ldrh gS vkSj fdlh nwljh
Car dk Color Blue Hkh gks ldrk gSA ge fdlh Car ds Color dks Red Color ls Hkh Paint
dj ldrs gSa vkSj White Color ls Hkh Paint dj ldrs gSaA Real World esa fdlh Hkh Object
dh fLFkfr esa ifjorZu fd;k tk ldrk gSA mlh izdkj ls Computer esa Hkh fdlh Object ds
Color State ;k Attribute dk eku Change fd;k tk ldrk gSA
45
www.BccFalna.com
C++ in Hindi
ge ;s Hkh dg ldrs gSa fd Real World esa ,d Object esa mlds Attributes ds eku dks
Change djus dh {kerk gksrh gSA ,d Real World Object ftl Operation dks Perform
djds viuh fLFkfr ;k Appearance esa ifjorZu djrk gS] ml Operation dks Object dk
Behavior ;k Object dh Ability dgrs gSaA pfy,] ,d vkSj mnkgj.k ns[krs gSaA
ge lHkh us ns[kk gS fd cMs “kgjksa esa dbZ&dbZ eaftyksa dh bekjrsa gksrh gSa blfy, vDlj mu
eaftyksa ij igqapus ds fy, Lift dk iz;ksx fd;k tkrk gSA Lift dks lkekU;r;k Elevator dgrs gSaA
Elevator Hkh ,d Real World Physical Object gS] D;ksafd ge bls ns[k vkSj Nw ldrs gSaA ;fn
ge bldh States o Appearance ;kuh Characteristics dks Describe djsa rks bl Elevator
dk fuEukuqlkj Description ns ldrs gSa%
1 ,d Elevator fdlh uk fdlh eafty (Floor) ij :dk gqvk ;k fLFkr gks ldrk gSA
2 ,d Elevator vf/kdre pkj yksxksa dks ogu dj ldrk gSA
3 ,d Elevator esa dqN Buttons gksrs gSa] ftudks Press djds fofHkUu Passengers
fdlh uk fdlh Floor ij igqap ldrs gSaA
4 ,d Elevator esa ,d njoktk gks ldrk gS tks Open o Close gksrk gSA
fdlh Elevator esa ;s pkjksa xq.k gks ldrs gSa tks ml Elevator dh fLFkfr o Appearance dks
Describe dj jgs gSaA ysfdu ;s Elevator Passengers dh bPNkuqlkj dqN Operations Hkh
Perform dj ldrk gS] D;ksafd bu Operations dks Perform djus dh Ability Hkh ,d
Elevator Object esa gksrh gSA Elevator dh bu Abilities dks fuEukuqlkj Describe fd;k tk
ldrk gS%
1 ,d Elevator fdlh Hkh le; fdlh uk fdlh Floor ij fLFkr gksxk] blfy, og viuh
Current State esa ifjorZu djus ds fy, viuh eafty (Floor) ls Åij dh eafty
(Floor) ij tk ldrk gSA
2 ,d Elevator fdlh Hkh le; fdlh uk fdlh Floor ij fLFkr gksxk] blfy, og viuh
Current State esa ifjorZu djus ds fy, viuh eafty (Floor) ls uhps dh eafty
(Floor) ij vk ldrk gSA
3 Passengers Elevator esa izos”k dj ldsa vkSj Elevator ls ckgj fudy ldsa] blds
fy, ,d Elevator dk njoktk (Door) Open ;k Close gks ldrk gSA
4 tc dksbZ Passenger fdlh eafty ij tkus ds fy, ml eafty dk dksbZ Number
Press djrk gS] rc Elevator ;s Calculate dj ldrk gS fd mls fdl txg tkuk gSA
5 ,d Elevator ;s Hkh irk yxkrk gS fd ml Building ds vU; Elevators fdl fLFkfr
(Floor) ij gSaA
46
www.BccFalna.com
C++ in Hindi
//Characteristics (Attributes or States)
1 noOfCurrentFloor
2 noOfPassengers
3 listOfButtonsPushed
bl mnkgj.k ls ge le> ldrs gSa fd ,d Real World Physical Object esa Hkh okLro esa nks
Components gksrs gSaA igyk Component Object dh fLFkfr crkrk gS vkSj nwljk
Component Object dh {kerk crkrk gSA tc ,d Real World Physical Object ds Hkh nks
Component gksrs gSa rks ml Object dks Represent djus okyh Logical Class esa Hkh bu
nksuksa Components dk Description gksuk pkfg,] rkfd Computer dk Logical Object Real
World ds Physical Object dks iwjh rjg ls Represent djsA
,d vkSj mnkgj.k ysrs gSa] Real World ds Class o Objects dh ifjHkk’kk ds vuqlkj nqfu;k dh
gj pht dks mldh Class cuk dj] ml Class ds Instance ;kuh Object ds :i esa ifjHkkf’kr
fd;k tk ldrk gSaA blh vk/kkj ij vki Hkh ,d Real World Physical Object gSa vkSj fdlh
,d le; ij vki Hkh fdlh uk fdlh ,d Class ds Instance gksrs gSaA
mnkgj.k ds fy, eku yhft, fd vki ,d Student gSa vkSj 10th Class esa i<rs gSa blfy, vki
Hkh ,d Student dk mnkgj.k (Instance) gSa D;ksafd vkidks fdlh d{kk (Class) dk ,d fo|kFkhZ
(Object) dgk tk ldrk gSA vki tSls gh dbZ vkSj Students gksaxs tks vkids lkFk i<rs gksaxsA
ekuyks fd 10th Class esa i<us okys lHkh Students dks eq[; :i ls 6 Subjects i<us gksrs gSaA
lHkh Students dks lHkh izdkj ds Exams nsus gksrs gSaA lHkh Students leku le; ij Class
esa tkrs gSa vkSj ,d le; esa lHkh Students leku Subject i<rs gSaA tc ,d d{kk ds lHkh
Students ml d{kk esa tks Hkh dke djrs gSa] os lHkh dke lHkh dks ,d lkFk djus gksrs gS rks bl
vk/kkj ij ge ;s dg ldrs gSa fd vki lHkh Student ,d gh d{kk (Class) ds fo|kFkhZ(Objects)
gSa] D;ksafd vki lHkh ,d gh d{kk dh lHkh fLFkfr;ksa (States) dks ,d lkFk ogu djrs gSaA
lHkh Students dks ,d lewg ds :i esa ns[kk tk, rks lHkh Students Objects dk ,d ,slk
lewg (Entity Set) gS] tks dbZ leku Features dks Share djrs gSaA pwafd vki 10th d{kk ds
47
www.BccFalna.com
C++ in Hindi
lHkh fu;eksa (Descriptions) dk ikyu djrs gSa] blfy, vki 10th d{kk (Class) ds Students
(Objects) gSaA
bl mnkgj.k esa geus ns[kk fd ,d Student mldh d{kk dk ,d fo|kFkhZ gksrk gSA ;s
Description okLro esa d{kk dk Description gS vkSj d{kk ds Description ds vk/kkj ij cuh
Class dk Instance fo|kFkhZ gksrk gSA ;fn d{kk ds Description dks iznf”kZr djus okys
Attributes (Instance Variable) ds eku dks Change fd;k tk,] rks Student dk iwjk lewg
Change gks tkrk gS] uk fd dsoy ,d Student Change gksrk gSA
;kuh ;fn 10th d{kk dh Description Change djds 11th d{kk dh Description ys fy;k tk,]
rks ml d{kk ds lHkh fo|kFkhZ cny tkrs gSa] D;ksafd okLro esa iwjh d{kk gh cny tkrh gSA ysfdu
;fn ge pkgrs gSa fd ge Particular fdlh fo|kFkhZ dh Description cuk,a rks gesa d{kk dh
Class cukus ds ctk; Student dh Class cukuh gksxhA
vc ;fn ns[kk tk, fdl ,d Student ds lewg (Entity Set) dh ,slh dkSulh Characteristics
gksrh gSa] tks mls nqfu;ka ds lHkh Objects ls vyx cukrs gSa] rks ge ,d Student dh fuEu
Attributes ;k States izkIr dj ldrs gSa%
blh rjg ls ge ,d Student dh dbZ vkSj Attributes o States dk irk yxk ldrs gSaA
pfy,] Real World esa ge ns[krs gSa fd gj Object viuk dke [kqn djrk gSA
48
www.BccFalna.com
C++ in Hindi
ekuyks fd vki ,d Student gSaA D;k vkidks Hkw[k yxus ij vkidk [kkuk dksbZ vkSj [kk ldrk
gSA D;k vkidks I;kl yxus ij vkids fy, dksbZ vkSj ikuh ih ldrk gSA D;k ,slk gksrk gS fd
School tkrs le; vkidh Uniform dksbZ vkSj igus vkSj School vki pys tk,aA D;k ,slk gksrk
gS fd vkids cnys dksbZ vkSj vkidk Exam Fight djs vkSj feyus okyk Certificate vkids uke
dk gks vkSj vki dks izkIr gks tk,A
ugha! Real World esa ,slk ugha gksrkA blhfy, Computer esa Hkh ;fn ,slk gksrk gS] rks ml
Programming Language dks Object Oriented ugha dgk tk ldrkA “C++” esa Hkh ,slk ugha
gksrk gSA fdlh Class ds Description ds vk/kkj ij tks Object Create fd;k tkrk gS] ml gj
Object dk viuk Lo;a dk Attribute ;k States dks Represent djus okyk Lora= Variable
gksrk gS] ftlesa dsoy mlh Object ds Attributes ;k States ds eku gksrs gSaA
pfy,] vc Object ds Behavior ;k Ability ij FkksMk vkSj fopkj djrs gSaA ge lHkh bUlku gSaA
gekjh ,d Physical vkd`fr] jax] :i] yEckbZ vkfn gS] blfy, ge lHkh Human Being Class
ds Instances ;k Objects gSaA ;fn ge ,d Human Being Class dk Description nsuk pkgsa]
rks fuEu Description ns ldrs gSa%
bu lHkh States o Attributes ds vykok ,d Human Being esa dqN Abilities Hkh gksrh gSaA
dqN Abilities dks fuEukuqlkj Describe fd;k tk ldrk gS%
49
www.BccFalna.com
How to Get Complete PDF EBook
आप Online Order करके Online या Offline Payment करते हुए इस Complete EBook को तुरन्त
Download कर सकते हैं ।
Order करने और पु स् तक को Online/Offline Payment करते हुए खरीदने की पू री प्रक्रिया की क्रिस् तृत नानकारी प्रात
करने के क्रिए आप BccFalna.com के क्रनम्न Menu Options को Check Visit कर सकते हैं ।
नक्रक हरारे Old Buyers के Reviews भी दे ख सकते हैं ताक्रक आप इस ात का क्रनर्ण य िे सकें क्रक हरारे Buyers हरारे
PDF EBooks से क्रकतने Satisfied हैं और यक्रद आप एक से अक्रिक EBooks खरीदते हैं , तो Extra Discount की
Details भी Menubar से प्रात कर सकते हैं ।