C Programming - Declarations and Initializations - Discussion

Discussion Forum : Declarations and Initializations - Yes / No Questions (Q.No. 5)
5.
Is it true that a function may have several declarations, but only one definition?
Yes
No
Answer: Option
Explanation:

Yes, but the function declarations must be identical.

Example:

#include<stdio.h>

void Display();
void Display();
void Display();

void Display()
{
   printf("Weclome to IndiaBIX.com..!");
}

int main()
{
    Display();
    return 0;
}

//Output:
Weclome to IndiaBIX.com..!
Discussion:
12 comments Page 2 of 2.

Yogesh Agrawal said:   1 decade ago
There is no advantage of several declaration. Just it does not give any error.

Rovin varshney said:   1 decade ago
What is the advantages of several declaration.


Post your comments here:

Your comments will be displayed after verification.