Definition And Declaration - Programming Tutorials

Programming Tutorials

Programming Tutorials

Ads Here

Definition And Declaration

Definition is the place where variable is created (allocated storage). Declaration is a place where nature (type) of variable is stated, but no storage is allocated. Initialization means assigning a value to the variable. Variables can be declared many times, but defined only once. Memory space is not allocated for a variable while declaration. It happens only on variable definition. Variable declaration syntax data_type variable_name; example int a, b, c; char flag; Variable initialization syntax data_type variable_name = value; example int a = 50; char flag = 't';

No comments:

Post a Comment