#include <stdio.h>
#include <windows.h>
void main() {
unsigned long long fs;
ULARGE_INTEGER fb;
GetDiskFreeSpaceEx( NULL, &fb, NULL, NULL);
fs = fb.QuadPart;
printf( "Free: %lld MB\n", fs / (1024 * 1024) );
}
printf( "Free: %lu MB\n", (unsigned long) (fs.f_bavail * (fs.f_bsize / 1048576.0)));
I've came across this piece of code recently: It's wrong. Try to guess why and how to fix it.