C++ is an object-oriented programming language developed by Bjarne Stroustrup in 1979. It was developed as an enhancement of the C language to include object-oriented paradigm.
It is an Object-Oriented language unlike C which is procedural oriented programming, hence efficiently models real-world problems and supports large-scale applications like OS, compilers, and simulations.
A C++ executable is not platform-independent (compiled programs on Linux wonβt run on Windows), however, they are machine-independent.
For example: Linux/Windows/Mac OS which makes it Machine Independent but the executable file cannot run on different operating systems.
High Level Language
It is a High-Level Language, unlike C and has English-like syntax, making it easier to read, write, and understand.
It focuses on problem-solving while still allowing access to low-level features when needed.
Statically Typed
The type of every variable is declared or determined at compile time, not at runtime.
This provides early error detection and better performance compared to dynamically typed languages like Python and JavaScript.
Case Sensitive
Case-sensitive language, which means it treats uppercase and lowercase letters as different. For example, cin is used to take input from the input stream. But if the "Cin" won't work. Other languages like HTML and MySQL are not case-sensitive languages.
This ensures precision in naming but requires programmers to be careful with the use of letter cases.
Compiled
The source code is directly compiled into machine specific code, unlike Python.
Programs run faster and more efficiently compared to interpreted languages, while code is executed line by line.
Dynamic memory allocation
This allows allocating memory for variables or arrays at runtime using the new operator.
Dynamically allocated memory must be freed manually using the delete operator.
Existence of Libraries
Provides a rich collection of built-in libraries, including STL with data structures and algorithms, which save time, promote reusability, and simplify complex programming.
The Standard Template Library (STL) includes ready-to-use data structures (like vectors, stacks, queues, maps) and algorithms (like sorting, searching).
Multi-threading
Multithreading is a form multitasking, where multitasking can be process-based (running multiple programs) or thread-based (running multiple parts of the same program).
A multithreaded program contains two or more threads, each with its own execution path.
Fast and Simple
Simple syntax and supports both high-level and low-level programming.
It provides fast execution, making it ideal for performance-critical applications.
Templates
Templates allow writing generic functions and classes that work with any data type, avoiding code duplication.
They provide type safety at compile time, unlike macros in C, which only do text substitution.