#include <iostream>
#include <Windows.h>
using namespace std;
int main(void)
{
DWORD dwSPC, dwBPS, dwNOFC, dwTNOC;
GetDiskFreeSpace(TEXT("C:\\"), &dwSPC, &dwBPS, &dwNOFC, &dwTNOC);
cout << dwSPC << endl;
cout << dwBPS << endl;
cout << dwNOFC << endl;
cout << dwTNOC << endl << endl;
DWORD64 dw64 = dwSPC * dwBPS;
cout << "可用空间: " << (dw64 * dwNOFC) / 1024.0 / 1024.0 / 1024.0 << "GB" << endl;
cout << "容量: " << (dw64 * dwTNOC) / 1024.0 / 1024.0 / 1024.0 << "GB" << endl;
system("pause");
return 0;
}