Header Ads Widget

Responsive Advertisement



 C++ in Hindi - C++ Programming Language ये OOP(Object-Oriented Programming) Language है, इससे पहले भी 'Simula' ये भी OOP Language बनाई गयी थी | C++ Programming Language ये Middle Level Language है | C++ Programming को Windows, Linux, Mac OS या आदि Operating Systems पर चलाया जाता है | C++ Programming Language का इस्तेमाल Computer Software's बनाने के लिए किया जाता है |

C++ - Introduction and History of C++


Introduction of C++

  • C++ Programming Language ये OOP(Object-Oriented Programming) Language है, इससे पहले भी 'Simula' ये भी OOP Language बनाई गयी थी |
  • C++ में OOps concept के साथ कई features है |
    • Inheritance
    • Polymorphism
    • Abstraction
    • Encapsulation
  • C++ Programming Language ये Middle Level Language है |
  • C++ Programming को Windows, Linux, Mac OS या आदि Operating Systems पर चलाया जाता है |

History of C++

  • C++ Programming Language को बनाने की शुरुआत 1979 में हुई |

  • C Programming में ही कुछ बदल करके 'C with Classes' ये C का concept आया |
  • 'C with Classes' के साथ और भी कई concepts को बनाकर Bjarne Stroustrup ने 1983 में AT & T's Bell Labs में C++ Programming का अविष्कार किया गया |


Uses of C++

  • C++ Programming Language का इस्तेमाल Computer Software's बनाने के लिए किया जाता है |
  • Computer Software's के साथ-साथ Drivers, Computer Hardware's, servers के लिए भी इस्तेमाल किया जाता है |


C++ - OOPs Concept-

OOP ये Method Classes और Objects पर निर्धारित होता है |

OOP ये एक ऐसी concept है, जिसमे Object के data और function का data structure होता है |

C++ ये एक Procedural(C Programming जैसी) और OOP Language भी है |


नीचे OOP के कुछ concepts short में दिए हुए है |

  • Class : Class का जो object उससे related उसका behavior , properties या attributes को define किया जाता है |for eg. अगर कोई Animal है | तो class में उसका behavior, उसके body के parts और उनकी संख्या इनको define किया जा सकता है |
  • Object : Object को class पर create किया जाता है | Object के कई नाम हो सकते है, जो उसके data members से related होते है |
  • Inheritance : Inheritance में एक मुख्य class की attributes वो अपने sub-classes को inherit करता है | Inheritance में मुख्य class को base class या parent class कहते है और उसके अन्दर या उसके subclasses को derived class या child class कहते है |
  • Polymorphism : Polymorphism मतलब एक ही form में अनेक form होते है | इसमे same नाम के member function को अलग -अलग parameters होते है |example में एक shape के द्वारा square, Circle, Triangle इन सभी shapes को draw किया जा सकता है |
  • Abstraction : Abstraction में कुछ जरुरत के हिसाब से important data को दिखाया जाता है और कुछ data या internal processes को hide किया जाता है |
  • Encapsulation : Encapsulation data और class को combine करके एक class के अन्दर रखा जाता है | ये 'Data Abstraction' भी कहलाया जाता है |

C++ KeywordsDescription
asmAssembly Language लिखने के लिए इस्तेमाल किया जाता है |
autoStorage class का एक प्रकार है | जो Local variable के लिए भी इस्तेमाल होता है |
boolboolean variable declare करने के लिए इस्तेमाल होता है | for eg. True और False
breakLoops या statements को break करने के लिए इस्तेमाल होता है |
caseSwitch case statement को इस्तेमाल करने के लिए होता है |
catchthrow से exceptions handle करने के लिए इस्तेमाल होता है |
charcharacter variable declare करने के लिए इस्तेमाल होता है |
classclasses को declare करने के लिए इस्तेमाल होता है |
constConst ये एक स्थिर variable के लिए इस्तेमाल होता है |
const_castConstant variable को cast किया जाता है |
continueLoop को iterate किया जाता है |
defaultSwitch case statement के लिए इस्तेमाल होता है |
deleteDynamic memory allocation के लिए इस्तेमाल होता है |
doएक loop का प्रकार है | जिसके साथ while loop को इस्तेमाल किया जाता है |
doublefloating-point data-type है |
dynamic_castpointer के साथ इस्तेमाल होता है |
elseif के साथ statement को इस्तेमाल किया जाता है |
enumEnumeration data type का 'Keyword' है |
explicitConstructor convert करने के लिए इस्तेमाल होता है |
exporttemplate की definition को export किया जाता है |
externStorage class का एक प्रकार है | जिसका scope global होता है |
falseBoolean की एक value है |
floatFloating-point variable को declare करने के लिए इस्तेमाल होता है |
forLoop का एक प्रकार है |
friendnon-member function; private data में access करने के लिए इस्तेमाल होता है |
gotoएक statement है , जिसमे label होता है |
ifएक statement है | जिससे condition सही है या गलत इसका पता चलता है |
inlinefunction के लिए इस्तेमाल होता है |
intinteger variable को declare करने के इस्तेमाल होता है |
longlong integer variable को declare करने के इस्तेमाल होता है |
mutableएक storage class का प्रकार है |
namespacesame indetifiers(variables, functions, classes) अलग-अलग बताने के लिए इस्तेमाल होता है |
newDynamic memory allocation के लिए इस्तेमाल होता है |
operatorOverloaded operators को declare करने के लिए इस्तेमाल होता है |
privateClass के private members को declare करने के लिए इस्तेमाल होता है |
protectedClass के protected members को declare करने के लिए इस्तेमाल होता है |
publicClass के public members को declare करने के लिए इस्तेमाल होता है |
registerएक storage class का प्रकार है |
reinterpret_castVariable का cast-type change करने के लिए इस्तेमाल होता है |
returnfunction के लिए इस्तेमाल होता है |
shortshort integer variable को declare करने के इस्तेमाल होता है |
signedएक variable modifier है |
sizeofvariable का size return करने के लिए इस्तेमाल होता है |
staticएक storage class का प्रकार है |
static_castएक type_conversion है |
structstructure को define या declare करने के लिए इस्तेमाल होता है |
switchएक statement है |
templateGeneric Program को लिखने के लिए इस्तेमाल होता है |
thispointer को current object पर लाता है |
throwException Handling के लिए इस्तेमाल होता है |
trueBoolean की एक value है |
tryException Handling के लिए इस्तेमाल होता है |
typedefdata type को alias_name देने के लिए इस्तेमाल होता है |
typeidObject का वर्णन किया जाता है |
typenameClass का alternative है |
unionये keyword अपने members को एक ही memory location पर assign किया जाता है |
unsignedunsigned integer variable को declare करने के लिए इस्तेमाल किया जाता है |
usingnamespace के साथ इस्तेमाल किया जाता है |
virtualRuntime polymorphism के लिए इस्तेमाल होता है |
voidये कुछ भी return नहीं करता |

 C++ - Structure of Program-

Program का Structure :

Preprocessor#include <iostream.h>
Standard Namespaceusing namespace std;
return_type & main functionint main()
Opening curly brace{
ostream class objectcout<<"Hello World!";
return 0;return 0;
Closing curly brace}

ये Program C++ Programming में सबसे पहला और आसान Program है | ऊपर दिया हुआ Program सात भाग में बटा हुआ है |

  1. Preprocessor
  2. Standard Namespace
  3. main function
  4. {
  5. cout<<"Hello World!";
  6. return 0;
  7. }
1.Preprocessor : Program में सबसे पहले preprocessors/header को लिखा जाता है | ये preprocessors अलग-अलग काम के लिए विभाजित किये हुए है,
for eg. iostream.h में cin और cout आते है |
conio.h में getch function आता है |
और भी कुछ preprocessors है , जो Library functions में दिखाएंगे |

2.using namespace std; : ये एक Standard command library है | Program में input/Output के लिए इसका इस्तेमाल होता है | अगर इसका इस्तेमाल नहीं होता, तो cout और cin को कोई scope नहीं रह जाता | Program को बिना using namespace std; से इस्तेमाल किया जाता है | पर cout<< की जगह std::cout<< को लिखना पड़ता है |

3.int main() : यहाँ पर main function का return_type integer है | main function का return_type void भी लिखा जाता है पर void कोई भी value return नहीं करता | Program की शुरुआत main() function से होती है |

4.{ : हर function के codes या statements को curly brace open होने के बाद लिखा जाता है |

5.cout<<"Hello World!"; : cout को insertion operator(<<) के साथ लिखे हुए statement को output में print किया जाता है | इस statement को दो Double Quotes (" ") के अंदर लिखा जाता है |

6.return 0; : return 0 ये Program को बंद करने की अनुमति देता है | ये '0' main function को return करता है |

7.} : यहाँ पर } इस curly brace से main function को close किया है |


C++ Hello Program using namespace

Source Code :
#include <iostream.h>
using namespace std;

int main(){

	cout<<"Hello World!";

return 0;
}
Output :
Hello World!

एक टिप्पणी भेजें

0 टिप्पणियाँ