Home / Questions / What is the difference between variable declaration and variable definition in C?
Explanatory Question

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

👁 8,731 Views
📘 Detailed Answer
🕒 Easy to Read
Read the answer carefully and go through the related questions on the right side to improve your understanding of this topic.

Answer with Explanation

  • 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