is there any way to make platform independent code in C programming language?
Aamir Mansuri
2008-03-25 05:46:19 UTC
I am looking for the C program that can be platform independent like the java program. is it possible so?
Five answers:
dky
2008-03-25 21:57:49 UTC
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.html
Pfo
2008-03-25 13:19:10 UTC
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.
W W
2008-03-25 12:50:06 UTC
It would be pretty hard I think.. since each OS has its own machine code.
That is why Java and C# rock :)
2008-03-25 14:35:56 UTC
I would python before I installed the 10-gig .net plug-in. python can switch hit for you and keep things C.
?
2008-03-25 12:51:16 UTC
If you find out let the world know
ⓘ
This content was originally posted on Y! Answers, a Q&A website that shut down in 2021.