Show Menu
Cheatography

C++ Beginners Cheat Sheet (DRAFT) by

This is a draft cheat sheet. It is a work in progress and is not finished yet.

Basic Data Types

int
Positive and negative whole numbers
unsigned int
Positive whole numbers
char
ASCII characters
float
Decimal numbers
double
Double­-pr­ecision decimal numbers

Variable Decele­ration & Initia­liz­ation

int x;
Declare an integer called
x
float x, y, z
;
Declare three floats,
x
,
y
and
z
char c = 'A';
Declare a character called
c
and initialize it to the letter 'A'
unsigned int x = 10, y, z = 5;
Declare three unsigned integers,
x
,
y
, and
z
, and initialize
x
to
10
and
z
to
5