The difference between Linux and Windows

Dec 27, 2012 at 2:03pm
I've seen some "Linux" code and then compared them with "Windows". Looked quickly they are "the same".

Is there any difference between C ++ Linux and Windows programming?

Thanks. :)
Last edited on Dec 27, 2012 at 2:04pm
Dec 27, 2012 at 2:35pm
Standard C++ will look the same everywhere. What differs is if you use different libraries, e.g. the WinAPI on Windows. You can't use the WinAPI on Linux so you will have to use something else. Some compilers have language extensions e.g. GCC's variable length arrays. If you want be cross platform you should try to stay away from language extensions and use cross platform libraries.
Dec 31, 2012 at 8:13pm
Anything from #include <windows.h> won't work on Linux. Anything from <sys/...> won't work on Windows. If you stay away from those headers you'll generally be ok. Some 3rd party libraries (aka DirectX) will be platform specific as well, but anything in std:: is safe to use.
Topic archived. No new replies allowed.