detecting os during runtime

how do i go about detecting the os during runtime rather than compile time?

(so that i only have to compile one program and it'll be able to run different code depending on what the os supports)
Last edited on
Do you mean different versions of the same OS? You can't, generally speaking, run the same executable on different platforms, so why would you want to include code that will never execute on that machine?
Topic archived. No new replies allowed.