What is C++

C++ is a general purpose programming language, created to extend the feature set of C to support an object orietned approach. It is a statically typed language, meaning that types of variables and return types of functions are determined at compile time, by the compiler. It has an extensive standard library, often reffered to as the stdlib, which provides a rich set of functions, algorythms and data structures to accomplish various tasks.

Fun fact: -> C++ compilers, due to C++ being what is effectivly a VERY spicy super set of C, will actually compile most C programs just fine.

Short C++ example.

#include <iostream>
int main() {
    int number;
    std::cout << "Enter an integer: ";
    std::cin >> number;
    std::cout << "You entered: " << number << std::endl;
    return 0;
}

Why use C++?

Mostly, to be honest, the use case of C++ is performance. Let's not pretend C++ is the easiest language to read, much less write. but the trade of for increased complexity is power. C++ allows you to have fine grained control over parts of your application that higher level languages cannot give access to.

Foremost above all, memory management. You are able to assign malloc and unnasign free memory at will with C++. (Although, you dont HAVE to do this, since C++ makes use of constructors and destructors (which will allocate and free memory a Class/struct needs to use, respectivly) , aswell as in more modern C++ (2011 onwards) smart pointers - these will assign and free memory as they need them.

C++ is also a portable language, since there is support for it with almost every operating system and architecture. So any code you write (unless you make use of specific APIs provided by a specific OS)