Notice: This page requires JavaScript to function properly.
Please enable JavaScript in your browser settings or update your browser.
Data Types | Variables and Data Types
C++ Introduction

Data TypesData Types

When declaring a variable, you need to specify what type of data we will store in it. There are data types for easy memory handling for every situation.

Data Types
int
bool
char
short
long
double

Numerical

These types are essential for storing numerical values and manipulating numeric data. We can split them into two groups:

  • Data types for whole numbers (e.g., 12);
  • Data types for floating point numbers (e.g., 0.12).

Bool

The bool data type represents two boolean values: zero interpreted as false and one is interpreted as true.

Light on = true = 1
Light off = false = 0

Char

The char data type is used to store individual characters, which can include letters, digits, punctuation marks, and special characters.

question-icon

What are the possible values of the bool data type?

Select a few correct answers

Everything was clear?

Section 2. Chapter 2
course content

Course Content

C++ Introduction

Data TypesData Types

When declaring a variable, you need to specify what type of data we will store in it. There are data types for easy memory handling for every situation.

Data Types
int
bool
char
short
long
double

Numerical

These types are essential for storing numerical values and manipulating numeric data. We can split them into two groups:

  • Data types for whole numbers (e.g., 12);
  • Data types for floating point numbers (e.g., 0.12).

Bool

The bool data type represents two boolean values: zero interpreted as false and one is interpreted as true.

Light on = true = 1
Light off = false = 0

Char

The char data type is used to store individual characters, which can include letters, digits, punctuation marks, and special characters.

question-icon

What are the possible values of the bool data type?

Select a few correct answers

Everything was clear?

Section 2. Chapter 2
some-alt