C++

what is c++?

C++ is general-purpose object-oriented programming (OOP) language developed by Bjarne Stroustrup.

Originally, C++ was called “C with classes,” as it had all the properties of the C language with the addition of user-defined data types called “classes.” It was renamed C++ in 1983.

C++ is considered an intermediate-level language, as it includes both high and low-level language features.

Using pointers, C++ allows self-memory management, that enhances the execution speed of a program. But it is necessary to explicitly free up the reserved space later on.

Since C++ allows to manipulate the processor on a lower level, it is quite faster than advanced level languages like Python or C#.

Some computer languages are written for a specific purpose. Like, Java was initially devised to control toasters and some other electronics. C was developed for programming OS. Pascal was conceptualized to teach proper programming techniques. But C++ is a general-purpose language. It well deserves the widely acknowledged nickname "Swiss Pocket Knife of Languages."

C++ Variable

A variable provides us with a named storage capability. It allows programmer to manipulate data as per the need. Every variable in C++ has a type. The variable type helps to determine the size and layout of the variable's memory map, the range of values that can be stored within that memory, and the set of operations that can be applied to it.

Variable Name or Identifiers

Identifiers can be composed of some letters, digits, and the underscore character or some combination of them. No limit is imposed on name length.

Identifiers must

  • begin with either a letter or an underscore ('_').

  • And are case-sensitive; upper and lowercase letters are distinct:

// defines four different int variables

int hackerinn, HACkeRInn, INNHACKER, HACKERINN;

The C++ language has reserved some names for its use.

There are many accepted conventions for naming variables in different programming languages. Following these conventions can improve the readability of the program.

  • An identifier should give at least some indication of its meaning.

  • Variable names are usually lowercase—hackerinn, not HACkeRInn or HACKERINN.

  • The classes we define usually begin with an uppercase letter.

  • Identifiers that contain multiple words should visually distinguish every word