Introduction to C++
What is C++?
C++ is a general-purpose programming language that grew out of C. It keeps C's speed and low-level control, and adds powerful tools for organising larger programs — most famously object-oriented programming with classes and objects. In short, C++ lets you write code that is both fast and well-structured.
Because it sits close to the hardware yet supports high-level ideas, C++ is a favourite wherever performance and control both matter.
A short history
C++ was created by Bjarne Stroustrup at Bell Labs. He started it in 1979 as "C with Classes" and the language was renamed C++ in 1983 — the ++ is C's own "add one" operator, hinting that C++ is "C, incremented." It has been standardised repeatedly, and modern versions like C++11, C++17 and C++20 keep adding useful features.
Why learn C++?
- It teaches both procedural and object-oriented programming, so it broadens how you think about code.
- It is extremely fast, which is why it is used in games, browsers and systems software.
- It is a top choice in competitive programming thanks to its speed and the Standard Template Library.
- Understanding C++ makes many other languages easier, since so many borrow its ideas.
Key features
| Feature | What it gives you |
|---|---|
| Object-oriented programming | Classes and objects to model real things |
| Speed and control | Close-to-hardware performance like C |
| Standard Template Library | Ready-made containers and algorithms |
| Function overloading & templates | Write flexible, reusable code |
| Rich standard library | Tools for I/O, strings, math and more |
A first look at C++ code
Here is a tiny complete C++ program. Do not worry about every detail yet — later lessons explain each part.
#include <iostream>
using namespace std;
int main() {
cout << "Welcome to C++!" << endl;
return 0;
}Welcome to C++!
#include <iostream>brings in input/output features.main()is where the program starts.coutprints text to the screen;endlends the line.
You will write and run this yourself in the first C++ program lesson, after setting up a compiler.
Where C++ is used
- Games and game engines (like Unreal Engine)
- Operating systems and device drivers
- Browsers and databases
- Competitive programming and high-performance computing
- Embedded systems and financial trading platforms
How this course is organised
We start with the basics — setting up a compiler, writing your first program, variables, input/output, loops and functions. Then we move to what makes C++ special: object-oriented programming (classes, inheritance, polymorphism) and the Standard Template Library. Each lesson has code you can run and practise with.
Summary
- C++ is a fast, general-purpose language built as an extension of C.
- It adds object-oriented programming, templates and the STL to C's speed.
- Bjarne Stroustrup created it; modern versions keep it up to date.
- It powers games, systems, browsers and competitive programming.
- This course starts with basics, then OOP and the STL.
Frequently Asked Questions
What is C++?
What is the difference between C and C++?
Is C++ hard to learn for beginners?
Why is C++ still used today?
Who created C++ and when?
C++ क्या है?
C++ एक general-purpose programming language है जो C से निकली। यह C की गति और low-level नियंत्रण रखती है, और बड़े programs व्यवस्थित करने के शक्तिशाली उपकरण जोड़ती है — सबसे प्रसिद्ध रूप से classes और objects के साथ object-oriented programming। संक्षेप में, C++ आपको ऐसा code लिखने देती है जो तेज़ भी हो और सुव्यवस्थित भी।
चूँकि यह hardware के करीब है फिर भी उच्च-स्तरीय विचार समर्थन करती है, C++ वहाँ पसंदीदा है जहाँ performance और नियंत्रण दोनों मायने रखते हैं।
संक्षिप्त इतिहास
C++ को Bjarne Stroustrup ने Bell Labs में बनाया। उन्होंने इसे 1979 में "C with Classes" के रूप में शुरू किया और 1983 में language का नाम C++ रखा गया — ++ C का अपना "एक जोड़ो" operator है, इशारा करते हुए कि C++ "C, एक बढ़ा हुआ" है। इसे बार-बार standardise किया गया है, और C++11, C++17 तथा C++20 जैसे आधुनिक versions उपयोगी features जोड़ते रहते हैं।
C++ क्यों सीखें?
- यह procedural और object-oriented दोनों programming सिखाती है, तो यह code के बारे में आपकी सोच को व्यापक बनाती है।
- यह बेहद तेज़ है, इसीलिए games, browsers और systems software में इस्तेमाल होती है।
- यह अपनी गति और Standard Template Library के कारण competitive programming में शीर्ष पसंद है।
- C++ समझना कई अन्य languages को आसान बनाता है, क्योंकि इतनी सारी इसके विचार उधार लेती हैं।
मुख्य विशेषताएँ
| विशेषता | यह आपको क्या देती है |
|---|---|
| Object-oriented programming | असली चीज़ें मॉडल करने को classes और objects |
| गति और नियंत्रण | C जैसा hardware-के-करीब performance |
| Standard Template Library | तैयार containers और algorithms |
| Function overloading और templates | लचीला, पुनः-प्रयोग योग्य code लिखना |
| समृद्ध standard library | I/O, strings, math और अधिक के उपकरण |
C++ code की पहली झलक
यह एक छोटा पूरा C++ program है। अभी हर विवरण की चिंता न करें — आगे के lessons हर हिस्सा समझाते हैं।
#include <iostream>
using namespace std;
int main() {
cout << "Welcome to C++!" << endl;
return 0;
}Welcome to C++!
#include <iostream>input/output features लाता है।main()वह जगह है जहाँ program शुरू होता है।coutscreen पर text print करता है;endlline समाप्त करता है।
Compiler set up करने के बाद आप इसे खुद पहला C++ program lesson में लिखेंगे और चलाएँगे।
C++ कहाँ इस्तेमाल होता है
- Games और game engines (जैसे Unreal Engine)
- Operating systems और device drivers
- Browsers और databases
- Competitive programming और high-performance computing
- Embedded systems और financial trading platforms
यह course कैसे व्यवस्थित है
हम basics से शुरू करते हैं — compiler set up करना, पहला program लिखना, variables, input/output, loops और functions। फिर हम उस ओर बढ़ते हैं जो C++ को विशेष बनाता है: object-oriented programming (classes, inheritance, polymorphism) और Standard Template Library। हर lesson में code है जिसे आप चला और अभ्यास कर सकते हैं।
सारांश
- C++ एक तेज़, general-purpose language है जो C के विस्तार के रूप में बनी।
- यह C की गति में object-oriented programming, templates और STL जोड़ती है।
- Bjarne Stroustrup ने इसे बनाया; आधुनिक versions इसे अद्यतन रखते हैं।
- यह games, systems, browsers और competitive programming चलाती है।
- यह course basics से शुरू होकर फिर OOP और STL पर जाता है।