What is the difference between variable declaration and variable definition in C?

Short Answer
Views 8605

Answer:

  • Variable declaration tells the compiler about data type and size of the variable. Whereas, variable definition allocates memory to the variable
  • Variable can be declared many times in a program. But, definition can happen only one time for a variable in a program.
  • Variable declaration is for assignment of properties and identification to a variable. Whereas, variable definition is for assignments of storage space to a variable

Related Articles:

This section is dedicated exclusively to Questions & Answers. For an in-depth exploration of C Programming Language, click the links and dive deeper into this subject.

Join Our telegram group to ask Questions

Click below button to join our groups.