As the comments stated, it’s not entirely clear where your problem is. It would be nice if you included an example for what you want to understand better, anyway, here’s an example:
#include <iostream>
void foo(int x) {
std::cout << x << std::endl;
}
void foo(int* x) {
std::cout << (*x + 1) << std::endl;
}
int main() {
int x = 4;
foo(x); // prints 4
foo(&x); // prints 5
return 0;
}
1
solved Write a program to elaborate the concept of function overloading using pointers as a function arguments? [closed]