The general rules for naming variables are:
Names can contain letters, digits and underscores
Names must begin with a letter or an underscore (_)
Names are case sensitive (myVar and myvar are different variables)
Names cannot contain whitespaces or special characters like !, #, %, etc.
Reserved words (like C++ keywords, such as int) cannot be used as names
Basic Data Types
The data type specifies the size and type of information the variable will store:
Data Type Size Description
*boolean 1 byte Stores true or false values
*char 1 byte Stores a single character/letter/number, or ASCII values
*int 2 or 4 bytes Stores whole numbers, without decimals
*float 4 bytes Stores fractional numbers, containing one or more decimals. Sufficient for storing 7 decimal digits
*double 8 bytes Stores fractional numbers, containing one or more decimals. Sufficient for storing 15 decimal digits
Operators are used to perform operations on variables and values.
C++ divides the operators into the following groups:
Arithmetic operators
Assignment operators
Comparison operators
Logical operators
Bitwise operators
Top comments (1)
!!!