C++ एक object oriented programming language है। C++ Bjarne stroustrup के द्वारा develop की गयी थी। C++ के आने से पहले c और Simula 67 दो popular languages थी।
Bjarne stroustrup इन दोनों languages को मिलाकर एक ऐसी language बनाना चाहते थे, जिसमे object oriented programming के सभी features हो। उनकी इसी सोच का परिणाम C++ थी।
C++ को 1979 में bell laboratories में develop किया गया था। C++ एक middle level language है। इसमें high level और low level languages के फीचर्स है। C language के सभी features C++ में पाये जाते है। C++ के 3 important features है।
1. Object oriented
2. Low level as well as high level
3. Easy to learn
Uses of C++
1. सामान्यतः C++ को ज्यादातर उन software में यूज़ किया जाता है जँहा Hardware के ऊपर अधिक control की आवश्यकता होती है। जैसे की device drivers बनाने के लिए C++ का इस्तेमाल किया जाता है।
2. यह एक multipurpose language है। इसे आप बड़े software क्रिएट करने के लिए इस्तेमाल कर सकते है।
3. आज कल C++ को ज्यादातर education के purpose से यूज़ किया जाता है। क्योंकि सभी बड़ी languages के features C++ से लिए गए है। यदि आप C++ को समझ गए है तो बाकि languages को भी आसानी से समझ सकते है।
4. C++ c language का extension है। इसलिए वो सभी software जो c बनाये जा सकते है वो C++ में भी बनाये जा सकते है।
5. यदि आप चाहते है की आपका software low level पर भी उतने ही अच्छे तरीके से काम करे जितना high level पर तो आप C++ यूज़ कर सकते है।
6. Mostly जितनी भी नयी programming language है वो pointer को खुलकर support नहीं करती है। यदि आप pointers के इस्तेमाल से कोई software क्रिएट करना चाहते है तो आप C++ का यूज़ कर सकते है।
Object Oriented Principles
C++ द्वारा support किये जाने वाले object oriented principle के बारे आगे बताया गया है।
Class
Class एक user defined data type होती है। ये C language में structure की तरह ही होती है। लेकिन classes में आप variable के साथ साथ उनसे related functions भी create कर सकते है जिन्हें बाद में objects के द्वारा access किया जा सकता है।
एक class programmer को data centered approach provide करती है। Class के द्वारा आप variables और उनसे related functions को separate कर पाते है।
Objects
जैसा की आपको पता है class एक user defined data type होती है। Class type के variables को objects कहा जाता है। Object के द्वारा आप class के variables और functions को access कर सकते है।
Abstraction
Abstraction का मतलब होता है की end user को वही functionality show की जाए जिसकी उसको जरुरत है बाकी background functionality hide कर दी जाए। उदाहरण के लिए जब आप एक car को चलाते है तो आप सिर्फ clutch, gear और steering पर ध्यान देते है, engine किस प्रकार काम कर रहा है इससे आपका कोई मतलब नहीं होता है।
Encapsulation
दूसरे शब्दों में encapsulation को data hiding भी कहते है। Encapsulation एक object oriented programming feature है जो data members (variables ) और उनसे related functions को bind करता है जैसे की class होती है।
साथ ही encapsulation के द्वारा data और functions को outside access से protect किया जाता है। Encapsulation properties 3 level (Public, Private, Protected) का protection provide करती है। Encapsulation classes के माध्यम से implement किया जाता है।
Inheritance
Inheritance object oriented programming का concept है जिसमे एक code को दूसरी जगह यूज़ किया जा सकता है। ये principle code re-usability implement करता है। उदाहरण के लिए आप एक class में create किये गए functions को दूसरी class में inherit कर सकते है ऐसा करने से आपको इन functions को दुबारा लिखने की आवश्यकता नहीं होगी। और आप इन्हें दोनों ही classes के objects से access कर पाएंगे।
Polymorphism
Polymorphism का मतलब एक नाम कई काम होता है। इसमें आप एक नाम से कई तरह के tasks implement करते है। C++ में polymorphism function overloading द्वारा implement किया जाता है जिसमें एक नाम के functions को अलग अलग conditions में execute किया जाता है।
Message Passing
Object oriented programming में objects एक दूसरे से communicate करते है जिससे program real life condition को represent करता है।
A Sample C++ program
#include<iostream>
int main()
{
cout<<“Hello Reader”;
return 0;
}
1. सबसे पहली line में header file को include किया गया है। Screen पर output show करने के लिए आपको इस header file की जरुरत पड़ती है।
2. इसके बाद program का main method शुरू किया गया है।
3. cout function के द्वारा simple message को print किया गया है।
4. return statement के द्वारा function को return किया गया है।
ऊपर दिया गया program निचे दिया गया output generate करता है।
Hello Reader
Introduction to C++
Table of Contents
Share with your friends
Share on facebook
Facebook
Share on twitter
Twitter
Share on whatsapp
WhatsApp
Share on pinterest
Pinterest
Share on linkedin
LinkedIn

Anil Computers
Best computer Institute in Udaipur








सर्टिफिकेट पाने के लिए अपने रिजल्ट का Screen shot नीचे दिये गये मोबाइल नम्बर पर send करें। साथ ही एक बार काॅल जरूर कर लेवें।
- 9414234600
A very good institute for all student who want to learn computer basic and other courses and the staff is very helping nature ...
Rekha Paliwal
Thank you Anil computers. Had a great learning session with the institute..Teachers are highly concentrated towards to the students
Hardeep Singh
It is the best computer class for c and c++ course . It was a great experience there, and the staff is very helping and kind to all .
Phalguni Bhatia
Previous
Next
This Post Has 11 Comments
very nice for c langauge basic
Thx
Nice Blog
Thanks
Very Nice
very Nice
Thx
Good……
Nice…….
very helpful
Thx for this blogs
good