Operating System version number

This is a discussion on Operating System version number within the Windows Programming forums, part of the Platform Specific Boards category; Hi all, Is there any program in C++ that extracts the version number of the Operating system being used in ...

  1. #1
    Registered User
    Join Date
    Jun 2007
    Location
    Qatar
    Posts
    39

    Operating System version number

    Hi all,
    Is there any program in C++ that extracts the version number of the Operating system being used in the system.If, yes wats that.

  2. #2
    and the Hat of Guessing tabstop's Avatar
    Join Date
    Nov 2007
    Posts
    14,185
    You would need to use a system() call, most likely, and what you call will depend on the OS (i.e., there's not something out there that's going to work on windows, mac, and debian all at the same time).

  3. #3
    and the hat of sweating
    Join Date
    Aug 2007
    Location
    Toronto, ON
    Posts
    3,545
    I wouldn't use a system() call on Windows, I'd probably use GetVersionEx().
    As for Linux, there's probably a better call for that, but I'm too lazy to look it up right now.

  4. #4
    Registered User
    Join Date
    Jun 2007
    Location
    Qatar
    Posts
    39
    i just want to focus on windows operating system only

  5. #5
    C++ Witch laserlight's Avatar
    Join Date
    Oct 2003
    Location
    Singapore
    Posts
    21,719
    Moved to Windows programming.
    C + C++ Compiler: MinGW port of GCC
    Version Control System: Bazaar

    Look up a C++ Reference and learn How To Ask Questions The Smart Way

  6. #6
    Chinese pâté foxman's Avatar
    Join Date
    Jul 2007
    Location
    Canada
    Posts
    404
    Well then, like cpjust said, look for GetVersionEx().

    If you are not familiar with MSDN, you should really take the time to see how it's organized; it will really pay off if you are doing Windows programming...
    I hate real numbers.

Popular pages Recent additions subscribe to a feed

Similar Threads

  1. How to detect the operating system at runtime?
    By sept in forum C Programming
    Replies: 26
    Last Post: 09-10-2008, 10:20 AM
  2. Nim Trainer
    By guesst in forum Game Programming
    Replies: 3
    Last Post: 05-04-2008, 04:11 PM
  3. Operating System
    By Houssen in forum C Programming
    Replies: 18
    Last Post: 04-22-2008, 12:51 PM
  4. Replies: 8
    Last Post: 03-10-2008, 12:08 PM
  5. Microsoft = The Best Operating System
    By Troll_King in forum A Brief History of Cprogramming.com
    Replies: 92
    Last Post: 02-08-2002, 12:32 PM

1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21