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 are the uses of null pointers?
What is the meaning of c in c language?
What is the use of volatile?
What does sizeof function do?
What is the use of a ‘ ’ character?
What are the keywords in c?
Why is structure important for a child?
How can I get random integers in a certain range?
What is #define size in c?
Explain how can I read and write comma-delimited text?
what is the c source code for the below output? 10 10 10 10 10 10 10 10 10 10 9 9 7 6 6 6 6 6 6 9 7 5 9 7 3 2 2 5 9 7 3 1 5 9 7 3 5 9 7 4 4 4 4 5 9 7 8 8 8 8 8 8 8 8 9
What is variable and explain rules to declare variable in c?
Why c is called a middle level language?
How do you determine a file’s attributes?
What math functions are available for integers? For floating point?