Saturday, May 22, 2010

Is there any way to make platform independent code in C programming language?

I am looking for the C program that can be platform independent like the java program. is it possible so?

Is there any way to make platform independent code in C programming language?
There is a C interpreter that can make your simple programs platform independent (as long as the interpreter itself is ported). This still relies on an interpreter and you may be better off using scripting languages or the virtual machine based languages like Java or Dotnet.





For what ever it is worth, a real good C interpreter (cint) can be found at:


http://root.cern.ch/root/CintInterpreter...
Reply:What you need to do is write OS layer components in C and have your program code target these layers, then distribute the appropriate layer for each platform. This will require recompilation for each platform. Like the other answer said: this is why Java and C# rock.
Reply:I would python before I installed the 10-gig .net plug-in. python can switch hit for you and keep things C.
Reply:If you find out let the world know
Reply:It would be pretty hard I think.. since each OS has its own machine code.





That is why Java and C# rock :)


No comments:

Post a Comment