PDA

Click to See Complete Forum and Search --> : OS indepentedent programs


sail3005
Jan 16th, 2001, 05:14 PM
Is there ant compiler out there, or any way to make a c/c++ program that is basically OS independent? Not a fancy program, maybe just a Hello World program. One that could say run on the consule window in windows, in MS-DOS say from a bootdisk, and then maybe on Linux, mac OS, etc. Like java sort of... The OS doesn't matter.

parksie
Jan 16th, 2001, 05:16 PM
Not really. You can have portable code, but not a portable compiled program.

Why not use java? :p

sail3005
Jan 16th, 2001, 05:29 PM
Well, so what is the Java VM programmed in? ASM? How is it able to run on so many different OS's/platforms? Are there any other languages besides java that are that flexible? And one last question...Say that you were to write your own OS, would you have to write your own c++ compiler?

HarryW
Jan 16th, 2001, 05:33 PM
The Java Virtual Machine itself is OS-dependant, but the bytecode that runs on it isn't. Every platform that Java programs will run on needs to have a version of the JVM compiled for it.

Help
Jan 16th, 2001, 05:55 PM
Lets sum it up shall we
C is compiled Java is interpreted
:)