Hello there! This is that will be talking about basic types and their use in C++. Let’s get started!

 

C++ is able to do many kinds of stuff depending on what you code, it is not all about the Hello World activity. C++ can handle many kinds of stuff and for that we need to learn how to make use of the types.

 

The programming code is not aware of where is all our data going to but one thing he needs to be sure of is to know what type of information it´s being handled.

 

Types can be classified in to:

 

               Character types: this collection can represent just one character. The most common and used one is char which stores in one byte.

               Numerical integer types: These range can store any kind of whole numbers, like 1 or 500 the thing here is that fractional numbers are not accepted.

               Floating-point types: These can let you represent values with decimal point just as 34.89, and let’s you interact with them.

               Boolean types: This type bool, can be only represented in two circumstances, TRUE or FALSE.

 

Here`s a table of types with its description:

 

Type

Description

bool

true or false.

char

single octet, one byte. Integer

int

integer

float

A single-precision floating point .

double

A double-precision floating point.

void

absence of type.

wchar_t

wide character

 

 

 

 

 

 

 

 

 

 

 

 

 

Every type differs from its size; they can take different amounts of memory.

 

In floating point types, size affects the precision of the calculations.

 

All of the types listed before are known as arithmetic types.

 

C++ does accept a big range of types based on the fundamental ones, the other ones are known as compound and is one of the most important skills in c++ language.

WATCH MY VIDEO https://youtu.be/vCDCJ9CrCl4

 

CC BY 4.0 #Mastery09 – Basic types and their use in C++ by Ricardo Newton is licensed under a Creative Commons Attribution 4.0 International License.