11. Variables in C Programming
Variables :
In programming, a variable is a container (storage area) to hold data.
To indicate the storage area, each variable should be given a unique name (identifier).
Variable names are just the symbolic representation of a memory location.
For example:
int playerScore = 95 ;
Here, playerScore is a variable of integer type.
Here, the variable is assigned an integer value 95.
Rules for naming a variable :
1. A variable name can have letters (both uppercase and lowercase letters), digits and
underscore only.
2. The first letter of a variable should be either a letter or an underscore.
3. There is no rule on how long a variable name (identifier) can be. However, you may run into problems in some compilers if variable name is longer than 31 characters.
Comments
Post a Comment