Back to slide -- Keyboard shortcut: 'u'  previous -- Keyboard shortcut: 'p'  next -- Keyboard shortcut: 'n'          function-overloading/overloading-5.cc - double to Point via Point(double) constructor.Lecture 2 - slide 31 : 46
Program 6

#include <iostream>
#include <string>
#include "point.h"

using namespace std;

void f(Point p){
  cout << "f(Point)" << endl;
}

void f(char *c){
  cout << "f(char *)" << endl;
}









int main(){
  double c = 5.5;        
  f(c);                // A single best match: f(Point)
                       // f(char *) does not match at all.
}

// This example is continued in the next program...