2. Parameter declarations that differ only in a pointer * versus an array [] are equivalent.
int fun(int *ptr);
int fun(int ptr[]);
3. Parameter declarations that differ only in that one is a function type and the other is a pointer to the same function type are equivalent.
void fun(int ());
void fun(int (*)());
4. Parameter declarations that differ only in the presence or absence of const and/or volatile are equivalent.
int f(int x)
{
return x;
}
int f(const int x)
{
return x;
}
5. Two parameter declarations that differ only in their default arguments are equivalent.
int f ( int x, int y)
{
return x+10;
}
int f ( int x, int y = 10)
{
return x+y;
}
6. Member function declarations with the same name and the name parameter-type list cannot be overloaded if any of them is a static member function declaration.
class Test
{
static void fun(int i) {}
void fun(int i) {}
};
Answer:
Let see functions that can not be overloaded in C++.
1. Function declarations that differ only in the return type.
2. Parameter declarations that differ only in a pointer * versus an array [] are equivalent.
3. Parameter declarations that differ only in that one is a function type and the other is a pointer to the same function type are equivalent.
4. Parameter declarations that differ only in the presence or absence of const and/or volatile are equivalent.
5. Two parameter declarations that differ only in their default arguments are equivalent.
need an explanation for this answer? contact us directly to get an explanation for this answer6.Member function declarations with the same name and the name parameter-type list cannot be overloaded if any of them is a static member function declaration.