Golgappa.net | Golgappa.org | BagIndia.net | BodyIndia.Com | CabIndia.net | CarsBikes.net | CarsBikes.org | CashIndia.net | ConsumerIndia.net | CookingIndia.net | DataIndia.net | DealIndia.net | EmailIndia.net | FirstTablet.com | FirstTourist.com | ForsaleIndia.net | IndiaBody.Com | IndiaCab.net | IndiaCash.net | IndiaModel.net | KidForum.net | OfficeIndia.net | PaysIndia.com | RestaurantIndia.net | RestaurantsIndia.net | SaleForum.net | SellForum.net | SoldIndia.com | StarIndia.net | TomatoCab.com | TomatoCabs.com | TownIndia.com
Interested to Buy Any Domain ? << Click Here >> for more details...

what is the difference between declaration and definition
of a variable or function ?

Answer Posted / michael scofield

definition defines the memory area ( allocates the memory ) for the variable and the declaration tells about the signature of the variable ( type and size to be considered). definition occures once through the program( memory is allocated once ), but the declaration can occur many times.
OR For a variable, the definition is the statement that actually allocates memory. For example, the statement:
long int var;
is a definition. On the other hand, an extern reference to the same variable:
extern long int var;
is a declaration, since this statement doesn&#65533;t cause any memory to be allocated. Here&#65533;s another example of a declaration:
typedef MyType short;

Is This Answer Correct ?    4 Yes 0 No



Post New Answer       View All Answers


Please Help Members By Posting Answers For Below Questions

What are the 5 elements of structure?

1131


How does sizeof know array size?

1171


What does the error 'Null Pointer Assignment' mean and what causes this error?

1260


What is the difference between functions getch() and getche()?

1139


Difference between macros and inline functions? Can a function be forced as inline?

1351


What is a pointer and how it is initialized?

1233


What is the purpose of scanf() and printf() functions?

1300


What is the difference between arrays and pointers?

1174


i = 25;switch (i) {case 25: printf("The value is 25 ");case 30: printf("The value is 30 "); When the above statements are executed the output will be : a) The value is 25 b) The value is 30 c) The value is 25 The value is 30 d) none

1125


What do you mean by recursion in c?

1168


Can you add pointers together? Why would you?

1182


What is the difference between struct and union in C?

1387


What do you mean by c what are the main characteristics of c language?

1077


hw can we delete an internal node of binary search tree the internal node has child node..plz write progarm

2064


How can this be legal c?

1152