I am trying to convert a tool from C to C ++, so I can compile it as a CLR. I am a .NET guy, so this is far beyond my comfort zone.
I have a compilation error in the following line (tell me if there is not enough information):
if (qvartype[ currQ ] == FLOATING ) *range *= get_scale( currQ );
currQ is short . The error is defined in the get_scale function. This function is defined earlier:
#define get_scale( i ) ((short)pow( 10, (int)((long)(cat_names[ i ]))))
... which looks ridiculous to me, deep in a hellish style, but it compiles in C. However, in C ++, I get the following error message:
Error 374 error C2668: 'pow' : ambiguous call to overloaded function
I understand that C does not use the concept of overloads, but C ++ does, and the signature of the variable in this hot mess does not make it clear which function to call.
How to fix it? What would be the right way to write this for maximum compatibility with C ++?
source share