How to find which operating system is running the PC in C++?
inneedofhelp123
0
Newbie Poster
Recommended Answers
Jump to PostTo do this, you have to use Win32 (Windows API).
Example:
void GetOS(char theos[256]) { OSVERSIONINFO OS; OS.dwOSVersionInfoSize = sizeof(OS); GetVersionEx(&OS); switch (OS.dwPlatformId) { case 0: strcpy(theos,"Win3.1"); break; case 1: switch (OS.dwMinorVersion) { case 0: strcpy(theos,"Win95"); break; case 10: strcpy(theos,"Win98"); break; case 98: strcpy(theos,"WinMe"); break; } break; …
All 3 Replies
Knowledge72
0
Newbie Poster
deceptikon
1,790
Code Sniper
Team Colleague
Featured Poster
mike_2000_17
2,669
21st Century Viking
Team Colleague
Featured Poster
Be a part of the DaniWeb community
We're a friendly, industry-focused community of developers, IT pros, digital marketers, and technology enthusiasts meeting, networking, learning, and sharing knowledge.