Home >>C++ Tutorial >C++ Variable
Variable is used to store data.And also it is another name for the memory location. A variable can be reused several times as its value can be changed. In order to be identified easily, variables represent the memory location through symbol.
Here is the syntax of declaring the variables in C++
Datatype variable_name;
Examples for variable Declaration given below
int a; float b;
Here are the rules that are used for declaring a variable in C++:
Here is the example of the valid and invalid variables name:
Valid variable names:
int a; int _ab; int a30;
Invalid variable names:
int 10; int @ab; int a 30;