Description #
C++ is a general-purpose, high-performance programming language that extends the C language by adding object-oriented, generic, and functional programming features. It is widely used in systems software, game development, simulations, embedded devices, and large-scale applications requiring performance and control.
History #
C++ was developed by Bjarne Stroustrup at Bell Labs in the early 1980s. Originally called “C with Classes,” it was designed to add object-oriented features to the C language while retaining its speed and low-level capabilities.
The first commercial release of C++ was in 1985. Since then, it has undergone multiple updates:
- C++98/C++03 – early standards with templates and exceptions
- C++11 – introduced
auto
, lambda functions, smart pointers, and more - C++14, C++17, and C++20 – added ranges, concepts, and improved metaprogramming support
C++ remains a cornerstone of software engineering and continues to evolve under ISO standardization.
Hello World Code #
#include <iostream>
using namespace std;
int main() {
cout << "Hello, World!" << endl;
return 0;
}
How to Run #
Save the code as hello.cpp
Compile the program using a C++ compiler like g++:
g++ hello.cpp -o hello
Run the program:
./hello
📝 On Windows, run hello.exe
instead.
Key Concepts #
#include <iostream>
— imports input/output stream library
cout
— outputs data to the console
endl
— ends the line and flushes the stream
main()
— the program entry point
Semicolons end statements
Curly braces {}
define code blocks
Namespaces (like std
) avoid naming conflicts
Object-oriented — supports classes, inheritance, and encapsulation
Compiled language — must be built before execution
C++ Standard Library provides powerful containers and utilities
Try It Online #
🔗 OnlineGDB – C++ Compiler
🔗 Replit – C++
🔗 Programiz – C++ Compiler
Fun Facts #
- C++ powers game engines like Unreal Engine and AAA games
- It’s used in performance-critical applications like Adobe Photoshop, Chrome, and Microsoft Office
- Despite being fast, C++ supports abstraction and high-level constructs
- C++ is backward-compatible with C
- Bjarne Stroustrup is still active in the C++ community and academic world