Computer Science, asked by AyushLokhande1060, 1 year ago

How does a function definition differ from function declaration?

Answers

Answered by Anonymous
1

Function declaration means actual work of function what will be done by that function.

Function definition means the data type, parameters, and function name it can be written anywhere in a program ended by a terminator {;}.

Answered by letmeanswer12
1

Function definition different from function declaration:

A function is declared to inform the compiler about the name and type of the variable, initial value it takes etc. This implies the properties of the variable are detailed by the function declaration. So, any identifier must be declared before using it in the programs.  

The space to be used in the memory is decided by a function definition. It defines the space to be allotted in the memory device. It provides the actual body of the function. The way the variable is defined, it will be stored accordingly in the memory i.e., if it is an integer in C language, it will be stored as numbers with 4 bytes in memory.

Similar questions