0
What is the difference between declaration and definition of function or variable
4 Respostas
+ 2
The declaration provides the basic properties of a symbol: its type and its name. The definition provides all the details of that symbol - if it's a function, what it does; if it is a class, what fields and methods it has; if it's a variable, where is that variable located.
+ 1
Martin Taylor
I thought that declaration is just naming and specifying data type of function or variable and definition is loading that function or variable into memory.
But in C programming we don't have to define and declare identifier separately.
C define and declare with just one expression.
int MyNum; //This will define and declare at same time.
MyNum = 1234; //Initialization of identifier.