-2

Assume you have two classes A and , B has a constructor from A : B(A a).

Assume you have a non overloaded function f that takes an B object as a parameter : void f(B b) If I write f(a) the compiler will automatically call the B constructor from A. What is this called ?

1 Answers1

0

You probably mean a converting constructor.

Community
  • 1
  • 1
Mustafa
  • 1,814
  • 3
  • 17
  • 25