C++ is one of the most versatile languages in the world. It is used nearly everywhere for everything… systems programming (operating systems, device drivers, database engines, embedded, Internet of Things, etc.)

Enter Header Image Headline Here

Tuesday, 4 April 2017

C++ Portability


                                     C++ Portability



How do Java and C# create cross-platform portable programs, and why can't C++?

  • Why C++ is not cross platform dependent?
  • Why C++ is not a portable?
  • How Java is portable?
  • What makes Java and C# portable? 
  • We have summarized all the reason that makes Java and C# portable and C++ :


Reason :

Consider Scenario of C++ Language :

  • Portability of any language depends on the object code created by compiler.
  • C++ Compiler produces machine code which is directly executed by the CPU.
  • C++ Code is thus machine dependent and tied to particular Operating System (OS).
  • If we try to execute C++ program on the another Operating C++ then we must recompile program before executing program.

Consider Scenario of Java Programming Language  :

  • Java is created by Sun Micro System. [See: What is Java?]
  • Java compile produces intermediate code called Byte Code.
  • Byte Code i.e. intermediate code is executed by the Run Time  Environment.
  • In Java Run Time Environment is called as "JVM" can produce machine dependent code based on the intermediate code.
  • Here is Descriptive reason- Why Java is Portable?

    Consider Scenario of C# Programming Language :

  • C# was created by Microsoft.
  • C# compiler produces intermediate code called as MSIL (Microsoft Intermediate Language).
  • MISL i.e. intermediate code ic executed by CLR ( Common Language Run Time).
  • If we have CLR  already implemented on any platform then CLR can produce machine 
  • dependent code based on the intermediate code.
  • Re-commanded Article : Difference Between C# and Java.

0 comments:

Post a Comment

Popular Posts

Recent Posts

Categories

Unordered List

Text Widget