Interview Questions

What is the difference between declaring a variable and defining a variable?

C Interview Questions and Answers


(Continued from previous question...)

What is the difference between declaring a variable and defining a variable?

Declaring a variable means describing its type to the compiler but not allocating any space for it. Defining a variable means declaring it and also allocating space to hold the variable. You can also initialize a variable at the time it is defined.

(Continued on next question...)

Other Interview Questions