Lesson 5: Variables Flashcards
These are the names you give to computer memory locations which are used to store values in a computer program.
Variables
What are the rules in naming C++ variables?
- Start with alphabets or underscore
- No blank space
- No special characters
- No reserved keywords
- Up to 31 characters long
- Short and precise
- Naming conventions
- Unique names
- Meaningful names
It is when you specify a type and an identifier, but have not assigned a value to the variable.
Variable Declaration
It is the process of assigning a value to the variable.
Variable Initialization
What are the 2 types of variable initialization?
- Compile Time Initialization
- Run Time Initialization
It means to provide the value to the variable during the compilation of the program.
Compile Time Initialization
In this, the user has to enter the value and that value is copied to the required variable.
Run Time Initialization
It is an attribute associated with a piece of data that tells a computer system how to interpret its value.
Data Type
What are the data types?
- Integer
- Character
- Boolean
- Floating Point
- String
- Double Floating Point
- Void or Valueless
- Wide Character