Answer to Question #206574 in C++ for Lucy

Question #206574

Write a program to elaborate the concept of function overloading using pointers as a function arguments.


1
Expert's answer
2021-06-13T10:24:48-0400
#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;
}

Need a fast expert's response?

Submit order

and get a quick answer at the best price

for any assignment or question with DETAILED EXPLANATIONS!

Comments

No comments. Be the first!

Leave a comment

LATEST TUTORIALS
New on Blog