BlockWidth = 87
BlockHeight = 96
============================================================
int Width = (BlockWidth + 75);
int Height = (BlockHeight * 3) / (BlockWidth * 5) * Width;
char s[128];
wsprintf(s, "%d", Height);
MessageBox(0, s, "a" ,0);
为何这里会显示0呢?
BlockHeight = 96
============================================================
int Width = (BlockWidth + 75);
int Height = (BlockHeight * 3) / (BlockWidth * 5) * Width;
char s[128];
wsprintf(s, "%d", Height);
MessageBox(0, s, "a" ,0);
为何这里会显示0呢?
然后*width还是0除法时候至少一方非整型结果才不是整型
int Height = (BlockHeight * 3) / (BlockWidth * 5) * Width;
--->float Width = (BlockWidth + 75);
float Height = (BlockHeight * 3.0) / (BlockWidth * 5.0) * Width;