Computer Science - Object Oriented Programming Using C++ - Discussion

Discussion Forum : Object Oriented Programming Using C++ - Section 1 (Q.No. 45)
45.
C++ allows you to define the same functions more than once in the same program _____
if the definitions are identical
if the definitions are included in two separate #include files
if the definitions are located in a single #include file that is included more than once
C++ does not allow you to define the same functions more than once in the same program
Answer: Option
Explanation:
No answer description is available. Let's discuss.
Discussion:
5 comments Page 1 of 1.

Pankaj shrimali said:   8 years ago
in function overloading, the function name is same but a number of parameter and type of parameters are different. The question is:

C++ allows you to define the same functions more than once in the same program ____
We can't use the same functions more than once

So option D is correct.

Subhashini said:   1 decade ago
Same function can be overloaded with different return type and no of parameters. How can we say that C++ doesn't allow to define the same function in the same program?

Monali said:   1 decade ago
C++ does not allow multiple definition, it only allows multiple declarations of the same name which is called as function overloading.

Alok Kumar said:   8 years ago
By the definition of "function overloading", Defining multiple functions with same name.

So, Option D will be not correct answer.

Maya said:   1 decade ago
Function overloading is defining same function more than one time. How option D is correct?

Post your comments here:

Your comments will be displayed after verification.