This is Gokul. Can anyone explain me what is Code/binary portability..?
Imagine a program that starts:
It's obvious that it is not portable. You can't just compile the code on a different system (Windows, Mac, ...)
This is code portability. Most of the times its "solved" using conditional compiling like this:
This works because most of the compilers define the variable saying for which platform it is running.
The real solution is using functions that are standard and all platforms support.
Binary portability is another problem. After compiling a program to machine code, that code will run only on that specific platform. Examples:
x86, the standard intel & amd 32 bits processors
em64t, the new intel & amd 64 bits
powerpc, the old processor type used on Mac's
alpha, sparc, arm, itanium are other types
You can have for instance Linux on x86 or Linux on em64t. If you compile code for em64t it won't run on the x86 platform; you need to recompile it.
To avoid this, some languages like Java and .NET use bytecode, an independent binary form that gets translated to machine code at runtime using a virtual machine.
Hi..thank u very much
Separate names with a comma.