You are here:

C/'c' language

Advertisement


Question
what is difference between declaration &definition?

Answer
Dear sujana !

Take a look at this statements
 
 int a; /* declaration */
 a = 10 ; /* definition */

 From the first statement its quit clear that its an ordinary declaration , ie you are just declaring a variable of type integer , and make sure that the variable is  not yet defined .
   only information that the compiler know about the variable is that's of integer type and nothing other than that so by default it holds a garbage value until you define the value of the variable !

>> a = 10;
This is a definition , ie you are defining value of the variable 'a'

Thanks and Regards !
Prince M. Premnath

C

All Answers


Answers by Expert:


Ask Experts

Volunteer


Prince M. Premnath

Expertise


I'm sure that I can solve any doubts in Turbo C ,Graphics Programing ,Mouse, Hardware Programming ,File System ,Interrupts, BIOS handling , TSR Programming , General Concepts in C Language, handling inline Assembly statements

Experience

Research over 6+ Years

Organizations
CG-VAK Softwares and Exports Limited

Education/Credentials
Masters in Computer Applications

©2012 About.com, a part of The New York Times Company. All rights reserved.