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 5 types of inheritance in c ++?
Write a function that will take in a phone number and output all possible alphabetical combinations
What does 1f stand for?
Draw a flowchart to produce a printed list of all the students over the age of 20 in a class .The input records contains the name and age of students. Assume a sentinel value of 99 for the age field of the trailer record
What is the use of getch ()?
What are structural members?
Define the scope of static variables.
What is the size of empty structure in c?
What is the difference between āgā and āgā in C?
What is the benefit of using const for declaring constants?
Explain what header files do I need in order to define the standard library functions I use?
What are loops in c?
What are keywords c?
Explain what standard functions are available to manipulate strings?
What is the use of c language in real life?