I have the following line of codes to calculate the percentage of count/total.
In Microsoft Visual C++ 2005
printf("Count = %lu (%.2lf%%)\n", count, (double)count/(double)total*100.0);
In gcc
printf("Count = %lu (%.2lf\%)\n", count, (double)count/(double)total*100.0);
Both "count" and "total" are unsigned 64-bit integers. For some reason, I'm able to get the correct value in gcc, but always get 0.00% in Visual C++.
Why can't I get the correct value in Windows?