B
bintom
The following program uses overloaded functions. It works OK. But if
the commented function is made part of the program, the compiler
complains about ambiguity. Is this a case of of integer getting
promoted to float? Thanks in advance.
Bintom
void func(int i)
{ cout << "In func(int)\n\n"; }
/*
void func(float f)
{ cout << "In func(float)\n\n"; }
*/
void func(double d)
{ cout << "In func(double)\n\n"; }
int main()
{ func(3);
func(3.3);
}
the commented function is made part of the program, the compiler
complains about ambiguity. Is this a case of of integer getting
promoted to float? Thanks in advance.
Bintom
void func(int i)
{ cout << "In func(int)\n\n"; }
/*
void func(float f)
{ cout << "In func(float)\n\n"; }
*/
void func(double d)
{ cout << "In func(double)\n\n"; }
int main()
{ func(3);
func(3.3);
}