Write a program to elaborate the concept of function overloading using pointers as a function arguments.
#include <iostream>
using namespace std;
void print(int *m) {
cout << "m" << endl;
}
void print(double *n) {
cout<<"n" << endl;
}
int main() {
int x=5;
print(&x);
double y=21.34;
print(&y);
return 0;
}
Comments
Leave a comment