Turbo C++ and Gnu G++ (C++) (perhaps LLVM/clang) have different libraries. Their implementations of rand
, srand
and many (many!) functions will probably be different in HOW they provide the proper result.
Every function in those libraries will produce expected results, open
, read
, exit
and so on. (If they don't, they're not very 'standards conformant').
So rand
& srand
ARE working properly in each environment... they provide (and seed) random numbers.
HOW they arrive at that result is not defined, there are several methods of creating random numbers (See `Random number generation' for more info on RNG's)
Therefore, even given the same seed value, you cannot expect different RNG libraries to provide identical output. This will be true regardless of which source of libraries you use, Microsoft, Solaris, Linux, *BSD's, OSX and so on.
Only if the exact same method is used to derive the random numbers can you sort-of expect an identical series. Differences in entropy gathering may differ and create perturbations over time. I imagine someone will correct me about the 'sort-of', but as long as you're using the same libaries, you should get the same results from the same seeds. (same same same!)