C - Declaration and Definition

From EdWiki

Revision as of 09:30, 23 June 2015 by Jshankar (Talk | contribs) (1 revision imported: EdWiki -- Emsys pages from Shukra)

(diff) ← Older revision | Latest revision (diff) | Newer revision → (diff)

Declaration and Definition

  • Definition refers to the place where the variable is created or assigned storage.
  • Declaration refers to places where the nature of the variable is stated but no storage is allocated.
  • In other words, a declaration announces the properties of a variable(primarily its type); a definition also causes storage to be set aside.
  • There must be only one definition of an external variable among all the files that make up the program.
  • There may also be extern declarations in the file containing the definition.