Ok guys! I found a solution by doing it like this [guru mode]:
#define _WIN32_WINNT 0x0501 // I misunderstand that #include <windows.h> #include <iostream> #include <cstdlib> using namespace std; int main() { MEMORYSTATUSEX statex; statex.dwLength = sizeof (statex); // I misunderstand that GlobalMemoryStatusEx (&statex); cout << "Physical RAM => " << (float)statex.ullTotalPhys/(1024*1024*1024)<< endl; system("PAUSE"); return EXIT_SUCCESS; }
I needed to define _WIN32_WINNT 0x0501, but I donβt know why [guru mode is disabled].
If someone can explain to me what he does and why he does not work without him.
One more thing that is:
statex.dwLength = sizeof (statex);
Octopus
source share