Lesson 3: C++ Tokens Flashcards
The smallest element of a program
that is meaningful to the compiler.
token
used to store information to be referenced and manipulated in a computer program. ( Or in Short It Is the Container that holds the value)
Variables
________ is a name used to identify a variable, function, class, module, or any other user-defined item.
Identifier
Used to Indicate Integers
int
Used to store floating-point number (decimals and exponential)
float & double
Used in conditional statements and loops
bool
Used for characters and are enclosed inside single quotes
char
Used in storing text
string
What are the meaning of these Data Types:
1. int
2. float
3. double
4. char
5. bool
6. string
- Integer
- Floating-point
- Double floating-point
- Character
- Boolean
- Text
What are the sizes (in Byte) of these Data Types:
1. int
2. float
3. double
4. char
5. bool
6. string
1.) 2 or 4
2.) 4
3.) 8
4.) 1
5.) 1
6.) Depending on how many char
__________ are expressions with a fixed value.
Constants
_________ are the most obvious kind of
constants. They are used to express particular
values within the source code of a program.
Literals
These are numerical constants that identify integer values. They don’t need to be enclosed in quotes or other special character.
Integer Numerals
Express real values, with decimals and/or exponents. They can include either a decimal point, an e character that expresses scientific notations.
Floating Point Numerals
C++ allows the use of octal numbers (base 8) and hexadecimal numbers (base 16) as literal constants. For octal literals, the digits are preceded with a 0 (zero) character and for hexadecimal they are preceded by the characters 0x (zero, x)
Decimal Numerals