Export (0) Print
Expand All
Expand Minimize
3 out of 12 rated this helpful - Rate this topic

Compiler Error C2665

Error Message

'function' : none of the number1 overloads can convert parameter number2 from type 'type'

A parameter of the overloaded function cannot be converted to the required type. Possible resolutions:

  • Supply a conversion operator.

  • Use explicit conversion.

Example

The following sample generates C2665.

// C2665.cpp
void func(short, char*){}
void func(char*, char*){}

int main() {
   func(0, 1);   // C2665
   func((short)0, (char*)1);   // OK
}
Did you find this helpful?
(1500 characters remaining)
Thank you for your feedback

Community Additions

ADD
Show:
© 2014 Microsoft. All rights reserved.