Difference between Declaration and Definition - TGN

Latest

Welcome to Technicalgurunow! Your No. 1 source for all networking , earning and programming tutorials. We're dedicated to providing you the best of knowledgeable information with a focus on dependability. We hope you enjoy our blog.

Tuesday, December 3, 2019

Difference between Declaration and Definition

Declaration:-

  • It only introduces the name of an identifier along with its type to the compiler before it is used.
  • During declaration, no memory space is allocated to an identifier.

Definition:- 

  • Definition of an identifier means the declaration of an identifier also reservation of space for it in the memory.
  • The amount of memory space reserved for an identifier depends upon the data type of an identifier.
  • Identifiers of different data types take different amounts of memory space.
  • The memory space required by an identifier also depends upon the compiler and working environment used.

2 comments:

If you have any query, please let me know

Followers