Preprocessor “invalid integer constant expression” comparing int to double
问题 Somewhere in my code, I have preprocessor definition #define ZOOM_FACTOR 1 In another place I have #ifdef ZOOM_FACTOR #if (ZOOM_FACTOR == 1) #define FONT_SIZE 8 #else #define FONT_SIZE 12 #endif #else #define FONT_SIZE 8 #endif The problem is when I change ZOOM_FACTOR value to floating point value, for example 1.5 , I'm getting compile error C1017: invalid integer constant expression . Does anyone know why am I getting this error and is there any way to make a comparison between integer and