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
course content

Course Content

C++ Introduction

C++ Introduction

1. Getting Started
2. Variables and Data Types
3. Introduction to Operators
4. Introduction to Program Flow
5. Introduction to Functions

bookData 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.

Numerical

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

txt

integers

decimals

decimals

copy
12
// examples of literal integers 5 100 30

Bool

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

on = true = 1
off = false = 0

Char

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

cpp

main

copy
1234567
#include <iostream> #include <typeinfo> int main() { std::cout << "The data type is " << typeid(5).name() << std::endl; }

Everything was clear?

How can we improve it?

Thanks for your feedback!

Section 2. Chapter 1
some-alt