C Programming Variable
Table of Contents
In this chapter you will learn about C programming variable and variable naming conventions.
C Variable
Variable in programming are containers or storage areas.
Each variable is given a unique name (idenfifier) to indicate the storage area. A variable is a symbolic name to point to a memory location. For example:
int age = 30;
Here age is an integer type variable and is assigned the value 32.
A variable is named variable because its values can change.
In C Programming, variables must be declared before use.
Conventions for naming variables in C Programming
- A valid variable name can only contain letters (uppercase or lowercase), digits, and underscores (_).
- Variable names can be or any length. But the compiler chooses the first 31 characters as the variable name. So the first 31 characters of two variables in a program must be different .
- Variable names must begin with a letter or an underscore. However, starting variable names with underscores is discouraged. Because variable names with underscores is discouraged. Because variable names beginning with an underscore conflict with the system name, some errors may occur.
C is strongly a typed language. That is, the type of the variable does not change during program execution.
To learn more about data types visit our variable data types section.
Pingback: C Programming Constants -