The basic types of variable in C are namely char, int, double and float. First the variables have to be declared. This is done as follows:
First any of the data type defined above must be mentioned and this is followed by the name of the variable. For instance if wants to declare a variable v1 of type char it is done as follows
char v1;
While declaring a variable what happens is the data type is described to the compiler and no space or memory allocation takes place. In other words just the data types are mentioned without any memory storage for the data types. While defining the variable the declaring the data type of the variable along with space allocation for the variable takes place.
What is the difference between defining and declaring a variable?
The basic types of variable in C are namely char, int, double and float. First the variables have to be declared. This is done as follows:
First any of the data type defined above must be mentioned and this is followed by the name of the variable. For instance if wants to declare a variable v1 of type char it is done as follows
char v1;
While declaring a variable what happens is the data type is described to the compiler and no space or memory allocation takes place. In other words just the data types are mentioned without any memory storage for the data types. While defining the variable the declaring the data type of the variable along with space allocation for the variable takes place.
Profile Answers by GeekAdmin Questions by GeekAdmin
Questions by GeekAdmin answers by GeekAdmin
Related Answered Questions
Related Open Questions