![]() |
VOOZH | about |
C++ is a is a powerful, general-purpose programming language created by Bjarne Stroustrup at Bell Labs. It was first introduced as “C with Classes” in 1979 and later became C++ in 1983. Over the years, C++ has become widely used for building software, games, systems, and applications, and it offers unique features that make it stand out from other programming languages.
Here are some awesome facts about C++ that may interest you:
1. C++ Supports Both Procedural and Object-Oriented Programming, as it allows you to write traditional C-style functions for step-by-step tasks (procedural), while also letting you create classes and objects to model real-world entities (object-oriented).
Student: Khushi, Total Marks: 450 Average Marks: 90
2. C++ allows low-level memory manipulation using pointers. They store memory addresses and let you access or modify values directly, giving more control but requiring careful use.
Value of x: 10 Address of x: 0x7ffc3dde8edc Value using pointer: 10 New value of x: 20
3. C++ supports templates, which allow you to write a single piece of code that works with different data types. For example, you can create one function or class using templates, and use it for int, float, string, or any other type without rewriting the code.
15 6
4. C++ has the Standard Template Library (STL), which provides ready-made containers and algorithms. Containers like vector, map, and set help store data easily, while algorithms which let you perform common tasks quickly, saving you time and effort.
Sorted numbers: 1 2 5 7 9
5. C++ provides custom comparator where you can decide how to compare or sort things. You can write your own rules using a function or a small piece of code to control the order in which objects are arranged.
4 3 2 1
6. RAII (Resource Acquisition Is Initialization) in C++ is a programming technique where resources like memory, files, or sockets are acquired in a constructor and automatically released in the destructor. This ensures automatic cleanup when an object goes out of scope, preventing resource leaks and making code safer and easier to manage.
File opened File closed
7. A class can inherit from more than one class, allowing it to combine features from different classes called multiple inheritance. This is something rarely supported in other languages and gives you more flexibility in designing complex relationships.
Dog barks Cat meows Pet plays
8. You can make operators like + or - work for your own types, so objects can be added, subtracted, or compared just like numbers. this is called operator overloading.
Sum: 30
9. You don’t have to write the type of a variable. The compiler figures out the type automatically from the value you give, making your code shorter and easier to read using the auto keyword.
10, 3.14, Alice