hi,
Can any one tell me the correct difference between declaration , definition , initialization..
hi,
Can any one tell me the correct difference between declaration , definition , initialization..
BINNY
Great to see you again here BINNY !!!
A declaration introduces a name – an identifier – to the compiler. It tells the compiler “This function or this variable exists somewhere, and here is what it should look like.”
A definition, on the other hand, says: “Make this variable here” or “Make this function here.” It allocates storage for the name. This meaning works whether
you’re talking about a variable or a function; in either case, at the point of definition the compiler allocates storage.
extern const int x = 1; /* Initialization */
This initialization establishes this as a definition, not a declaration.
extern const int x; /* Declaration */
This declaration in C++ means that the definition exists elsewhere.
There are currently 1 users browsing this thread. (0 members and 1 guests)