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
How can I write a function that takes a format string and a variable number of arguments?
Write a program to print "hello world" without using a semicolon?
Why do we use pointer to pointer in c?
Explain what does the format %10.2 mean when included in a printf statement?
What are the different categories of functions in c?
What is a const pointer in c?
Define Spanning-Tree Protocol (STP)
Write a program to print fibonacci series without using recursion?
How can I do peek and poke in c?
What is c preprocessor mean?
An instruction which is analysed and acted upon by the processor prior to the compiler going its work a) directive b) constructive c) constant d) absolute mode
What are the ways to a null pointer can use in c programming language?
What is the code for 3 questions and answer check in VisualBasic.Net?
Is register a keyword in c?
What is data type long in c?