I can use the GetVersionEx()
function to get the Windows version, but this function will return a number and not a string. But there is no problem as I can convert the number to a string, for example:
if (osvi.dwMajorVersion == 6 && osvi.dwMinorVersion == 1)
{
printf("%s\n", "Windows 7");
}
But what if a new Windows version came out after releasing my program. I have to recompile my program to add the new Windows version!