Please i'm confused help he

Is it possible to define two functions as given below
func(int x, int y)
func(int &x, int &y)
closed account (9y8C5Di1)
Yes, it's called function overloading.
closed account (9y8C5Di1)
Actually, no, you cannot do that. Because the compiler won't know which function to call. However, if you used pointers on the second function it would work.

1
2
func(int x, int y)
func(int*x, int*y)


int main(){
int x,y;func(x,y);func(&x,&y);
return 0;}
Last edited on
Topic archived. No new replies allowed.