I'm having troubles with free disk code. Please take a look at my code.
This code does not work and I don't know why. Please help me.
# include <stdio.h>
# include <conio.h>
# include <windows.h>
int main ()
DWORD dwSectorsPerCluster, dwBytesPerSector, dwNumberOfFreeClusters, dwTotalNumberOfClusters, freeSpace;
if (GetDiskFreeSpace (NULL, &dwSectorsPerCluster, &dwBytesPerSector, &dwNumberOfFreeClusters, &dwTotalNumberOfClusters))
freeSpace = dwSectorsPerCluster * dwBytesPerSector * dwTotalNumberOfClusters;
gotoxy (10, 21);
printf ("Free space: %u", space/1024/1024/1024);
How to retrieve a disk capacity information?