In c programming language, When the compiler compiles a program, the obj file is created. When that object file is run, an .exe file is generated.
That .exe file contains the machine language instructions that are understandable by the underlying processor.
If we run that .exe file on another kind of processor [say processor x], that processor will not understand that machine language instruction.
But if we compile that source code again in that processor, will the compiler produce the machine language instruction that is understandable by that processor?
I mean platform dependent problem will occur only when we want to distribute .exe file?
There will not be problem if we get the whole source code (.c) file?

In Java programming, the compiler produces .class file. That file includes the byte codes that are understandable by JVM.
If we want to contribute our s/w, but not the source code [like .exe file in c], we can distribute .class file?
We can execute that .class file on any processor. But we can not read the source code of that?
That is right?

Whats this we are viewing u r posts because of thinking u need some help, but u r posting a lecture type paragraph here.I didn't understand whether u really have doubt r u want to write a article.if u want to write articles please use forums.But what u have said is write............

In c programming language, When the compiler compiles a program, the obj file is created. When that object file is run, an .exe file is generated.
That .exe file contains the machine language instructions that are understandable by the underlying processor.


One thing to keep in mind, when compiled, C code is then in an intermediate file called an object file. Once it is linked it can be an exe if it is on Windows, though on linux, Mac, and a host of others they are not called exe files. While you have it mostly right on the cross platform usage, keep in mind what you are programming for:

If you can do it in Java without causing a major problem in program execution speed, then that is cross platform enough. Any program that is overly complex would be better done in C or C++. Try to understand that the choice of a language to use is based on a lot of factors. Cross platform is only one part of the equation....

Hope this helps

This article has been dead for over six months. Start a new discussion instead.