- Contants
- Variables
- Keywords
- Data Types
- any information is constant
- Data = Information = Constant
- Primary
- Integer (5,100,-64,79,106)
- Real (5.0, 1.06)
- Character ('A', '5', '+')
- Secondary
- Array
- String ("Priyanshu")
- Pointer
- Union
- Structure
- Enumerator
- Class
- variables are the names of memory locations where we store data
- variable name is any combination of alphabet (a to z or A to Z), digit (0 to 9) and underscore (_)
- predined words used to perform certain operations
auto | double | int | struct | asm | private |
---|---|---|---|---|---|
break | else | long | switch | catch | public |
case | enum | register | typedef | class | protected |
char | extern | return | union | delete | template |
const | float | short | unsigned | friend | this |
continue | for | signed | void | inline | throw |
default | goto | sizeof | volatile | new | try |
do | if | static | while | operator | virtual |
- int (integer)
- char (Character)
- float (Real)
- double (Real)
- void
Unlike C, we can declare variables even after action statements in C++
Example :
int main()
{
clrscr();
int x=4;
}