definition: the meaning or description of person/place/thing
declaration: taking a stand
A declaration is an incomplete type whereas a definition is a complete type.
Perhaps an example will help. extern int value; /* declaration */ int value; /* definition */ int value= 20; /* definition with initialization */
Declaration is a promise: 'I will define (or has defined) this variable/function somewhere else'.
declaration examples:int main (void);extern int somevariable;definition examples:int main (void) { puts ("Hello world"); return 0; }int somevariable;
There is a difference
answering "What is the Difference between kotler's marketing definition and AMA marketing definition?"
Actually, there is a third step, call definition. Declaration is a statement to the compiler of what type an identifier is, definition is the allocation of memory for that identifier, and initialization is the assignment of an initial value to that identifier. Usually, declaration and definition are done together, but you can also add initialization in that step if desired. int a; /* declaration and definition */ a = 1; /* initialization */ int a = 1; /* declaration, definition, and initialization */ For the case of seperate declaration and definition, consider the struct... struct _mystruct { int a; }; /*declaration */ struct _mystruct mystruct; /* definition */ struct _mystruct { int a; } mystruct; /*declaration and definition */ Note: To be more precise: struct _mystruct; /* struct declaration */ struct _mystruct { int a; }; /* struct definition */ typedef struct _mystruct MYTYPE; /* type definition */ extern struct _mystruct mystructvar; /* variable declaration */ struct _mystruct mystructvar; /* variable definition */ struct _mystruct mystructvar = {7} ; /* variable definition with initialization */ struct _mystruct { int a; } mystruct; /* struct definition and variable definition */ extern struct _mystruct { int a; } mystruct; /* struct definition and variable declaration */
idek
gfkgdfuytdghtcfht
the difference between
There is no difference!!!
what is the definition of a canal