It depends. In general, Standard C ++ is a universal, portable language that can be compiled to work on any system or platform that has a standard compiler.
However, many more interesting features that you can add to a typical application are not part of Standard C ++. This includes graphical interfaces, threads, sockets, and low-level OS API calls. They are usually not portable, and the parts of the code that use these functions must be implemented separately for each operating system or platform.
Fortunately, it is not as difficult as it seems, because there are many cross-platform libraries that have already survived this problem. For example, the Boost threading library already has code for streaming written for different platforms or operating systems, but all this is abstracted for a good uniform API that can be used portable in the C ++ application code.
In addition, a lot of non-standard C ++ code still complies with some standard, for example POSIX , which is supported on several platforms.For example, most UNIX-ish systems, including Linux and Mac OS X, support POSIX streams (pthread API )
source share