Guys, I have lot of confusion about same basic concepts. I am posting whatever I feel is right(might be entirely different from reality)
It would be great if someone could explain
We have been taught that C++ is platform dependent since .exe generated in windows can't be run in linux.
But Java is platform independent as .class file can be run in any OS as long as JVM is written for that specific OS.
JVM means Java virtual machine so isn't it like a virtual machine like VM ware?
If it is, can't we write Virtual machine for C++ and make it platform independent.
I am aware about the steps involved in running a cpp code. Conversion of a .cpp to .exe involves many steps
Does .exe has machine code?
If yes, machine code is different for every machine so how does it run?
I also learned that every compiler assumes some processor for example turbo c compiler assumes 8086 processor.
so does it create a virtual environment of 8086 processor? if yes, is that the reason why turbo c cannot access more than 1 MB of RAM?
I know lots of things take place apart from what I mentioned. It would be great if I could get an abstract view of what's happening
It would be great if someone could explain
We have been taught that C++ is platform dependent since .exe generated in windows can't be run in linux.
But Java is platform independent as .class file can be run in any OS as long as JVM is written for that specific OS.
JVM means Java virtual machine so isn't it like a virtual machine like VM ware?
If it is, can't we write Virtual machine for C++ and make it platform independent.
I am aware about the steps involved in running a cpp code. Conversion of a .cpp to .exe involves many steps
Does .exe has machine code?
If yes, machine code is different for every machine so how does it run?
I also learned that every compiler assumes some processor for example turbo c compiler assumes 8086 processor.
so does it create a virtual environment of 8086 processor? if yes, is that the reason why turbo c cannot access more than 1 MB of RAM?
I know lots of things take place apart from what I mentioned. It would be great if I could get an abstract view of what's happening