I am reading Wikipedia article on difference btween JAVA and C++. One difference is that C++ offers ‘multiple binary compatibility standards’. Could you explain what this means, or hint at a good reference. I have a clue that it means that binary ‘written with’ C++ is very portable, can be used on any OS or environment. I would like to have confirmation and more precision. What is it all about?
How to generate binaries? What make it not portable?
Thanks and regards.
What does
intmean, exactly? When calling a function with 2 parameters – do you put the first one first on a stack or last; or do you have a structure on a heap and point to it? Do you allow an unknown number of arguments being passed into a function? How do you treat strings; arrays? Do you allocate on stack, heap, or in a private memory block? Do you mangle function names (to allow for overloads) or use them as input in source code? Do you align members in a structure on 8 bit, 16 bit, or 32 bit boundary?All those questions (and many more) are making a great deal of difference to how one binary calls another and the answers are not as simple most of the time.
Java doesn’t offer much in terms of how exactly a binary layout is being done (as it’s a VM, after all) while C++ offers great flexibility to accommodate almost any imaginable requirement out there – thus it “offers binary compatibility standards”, unlike Java (in your example)