Thread: Operating System version number

  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,336
    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
    28,413
    Moved to Windows programming.
    Quote Originally Posted by Bjarne Stroustrup (2000-10-14)
    I get maybe two dozen requests for help with some sort of programming or design problem every day. Most have more sense than to send me hundreds of lines of code. If they do, I ask them to find the smallest example that exhibits the problem and send me that. Mostly, they then find the error themselves. "Finding the smallest program that demonstrates the error" is a powerful debugging tool.
    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, 01:32 PM