🟢 Foundation  ·  Lesson 01

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

FeatureWhat it gives you
Object-oriented programmingClasses and objects to model real things
Speed and controlClose-to-hardware performance like C
Standard Template LibraryReady-made containers and algorithms
Function overloading & templatesWrite flexible, reusable code
Rich standard libraryTools 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.

main.cpp
#include <iostream>
using namespace std;

int main() {
    cout << "Welcome to C++!" << endl;
    return 0;
}
Output:
Welcome to C++!
  • #include <iostream> brings in input/output features.
  • main() is where the program starts.
  • cout prints text to the screen; endl ends 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++?
C++ is a general-purpose programming language built as an extension of C, adding support for object-oriented programming among other features. It is fast, gives direct control over hardware and memory, and is used for software where performance matters, such as games, operating systems and high-frequency systems.
What is the difference between C and C++?
C++ contains almost all of C and adds major features on top, most notably classes and objects for object-oriented programming, plus references, function overloading, templates and the Standard Template Library. C is procedural only, while C++ supports both procedural and object-oriented styles.
Is C++ hard to learn for beginners?
C++ is larger than many first languages because it offers several programming styles, but you can start with a small, friendly subset — input, output, variables, loops and functions — and grow from there. Learning the basics first and adding object-oriented features later makes it very approachable.
Why is C++ still used today?
C++ remains popular because it combines high performance with powerful abstractions, letting programmers write fast code that is still organised and reusable. It powers games, browsers, databases, operating systems and trading systems, and is a favourite in competitive programming.
Who created C++ and when?
C++ was created by Bjarne Stroustrup at Bell Labs, beginning in 1979 as "C with Classes" and renamed C++ in 1983. It has been standardised many times since, with modern versions such as C++11, C++17 and C++20 adding major new features.

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 libraryI/O, strings, math और अधिक के उपकरण

C++ code की पहली झलक

यह एक छोटा पूरा C++ program है। अभी हर विवरण की चिंता न करें — आगे के lessons हर हिस्सा समझाते हैं।

main.cpp
#include <iostream>
using namespace std;

int main() {
    cout << "Welcome to C++!" << endl;
    return 0;
}
Output:
Welcome to C++!
  • #include <iostream> input/output features लाता है।
  • main() वह जगह है जहाँ program शुरू होता है।
  • cout screen पर text print करता है; endl line समाप्त करता है।

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 पर जाता है।
← Back to C++ Tutorial
🔗

Share this topic with a friend

यह topic किसी दोस्त को भेजें

Found it useful? Send it to a classmate learning the same thing.

अच्छा लगा? जो दोस्त यही सीख रहा है, उसे भेज दीजिए।

💻 Live Code Editor

This page's programs are ready here — run them, edit them, and learn. No installation needed.
Powered by OneCompiler. The code loads into the editor automatically — press Run to see the output. If the editor does not open, open it in a new tab.