Main menu

Pages

C++ Datatypes - Learn CPP, It is a multi-purpose, structured, object-oriented programming language. It was invented by Bjarne Stroustrup at Bell Labs in 1979. It is a language similar to C. but it is more secure and includes many new technologies such as object-oriented programming. In fact, it is an upgraded version of the C language and was initially called (c with classes) where the language was changed in 1983 to the well-known name C++. indicating the increment factor of the language ++ and with time many features. were added until it developed and reached its current popularity. In 1985, the first book (The C++ Programming Language) was published to be the most important resource for the language because there was no unified standard at the time.


C++ features:


  1. A multi-paradigm programming language.
  2. The writing style is consistent.
  3. A translated language.
  4. C language compatible, but not 100%.
  5. A strong language is used in many operating systems.
  6. It is considered one of the leading languages in the development of large and complex projects.


The most important applications of C++:


  1. Firmware: It is software for systems of machines and mobile phones.
  2. Operating systems such as Windows, Apple OS X.
  3. Most Adobe programs such as Photoshop and Premier.
  4. Some Google applications such as google chrome.
  5. Mozilla Firefox Internet browser.
  6. Amazon app.

Data types in the C++ programming language


About data types in C++:



All variables use a certain type of data during the process of defining them in the program, so we can say that data types are used to tell variables what type of data. they can store, and whenever a variable is defined in the programming language (C++) the compiler allocates some memory for this The variable depends on the declared data type, and each data type requires a different amount of memory.


The most important data types in C++ are:


Basic Data Types:



These are built-in data types that can be used directly by the user to define variables. The following is a list of the most important of these types.


Integer

It is one of the keywords used with integers and usually this type reserves 4 bytes of memory space, and the keyword used for this type is (int).


Character

This type of data is used to store characters, characters usually require one byte of memory space, and the keyword used for this type of data is (char).


Boolean

The Boolean data type is used to store Boolean values and a variable can store the Boolean value (TRUE) or (FALSE), and the keyword used for the Boolean data type is (bool).


Floating Point

This type of data is used to store numbers containing a decimal point, the keyword used for this type of data is (FLOAT), and this type of data reserves 4 bytes of memory space.


void

means null without any value.


Wide character

This data type has a larger size than the normal data type and is represented by the wchar_t keyword.


C++ Programming For Beginners: Data types



Derived Data type:


They are data types that are derived from primitive or embedded data types, and these can consist of four main types.


  • Function.
  • Array.
  • Pointer.
  • Reference.


User-Defined Data Types:


These data types are defined by the user himself as the definition of a specific class in the programming language (C++) environment. and there are many of these types in the programming language (C++) and the most important of these types are.


  • Class
  • Structure
  • Union