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


Please Help Members By Posting Answers For Below Questions

Is register a keyword in c?

638


Explain what are linked list?

626


What are # preprocessor operator in c?

632


What is use of null pointer in c?

571


What is time null in c?

584






What are the types of assignment statements?

630


What does a function declared as pascal do differently?

607


write a c program to find the sum of five entered numbers using an array named number

1617


Where static variables are stored in c?

588


Hai what is the different types of versions and their differences

1491


application areas a 'c' a) operating system b) graphics, interpreter, assembler c) program evalution, communication softwares d) all the above

607


What is the easiest sorting method to use?

635


Explain the concept and use of type void.

630


Is it better to use malloc() or calloc()?

649


What is wrong with this program statement? void = 10;

822