detecting os during runtime

May 20, 2016 at 9:01pm
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 May 20, 2016 at 9:02pm
May 21, 2016 at 12:47am
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.