what is the difference between declaration and definition
of a variable or function ?
Answer Posted / suman_kotte
declares a function, but that does not define it.
declaration describes whether the function consist
arguments or not and also it will return a value or not.
definition must be as per the function declaration that was
declared rearlier.it will for the out put of that function.
ex;
main()
{
int a=1,b=2;
void sum(int , int );//declaration
sum(a,b);
}
void sum(int x, int y)//definition
{
printf("%d",x+y);
}
Is This Answer Correct ? | 8 Yes | 0 No |
Post New Answer View All Answers
What is static memory allocation? Explain
Can main () be called recursively?
What is character constants?
What is a const pointer?
Explain how do you print only part of a string?
Explain Basic concepts of C language?
Write a program to print all permutations of a given string.
What are the restrictions of a modulus operator?
Can we add pointers together?
What are the various types of control structures in programming?
What is 1f in c?
shorting algorithmS
Explain bit masking in c?
Why shouldn’t I start variable names with underscores?
What is boolean in c?