Hi Friends
Why C# codes are converted to IL and why C++ codes are converted to machine code not IL?
Loading
Know the answer? Post it — somebody with the same question will find it here.
Sign in to answer this question
It is the same account you read, post and publish with — and you will come straight back to this page.
VulpesPosted Mar 25, 2012, 9:14 AM
Like C#, this can produce an executable which consist of pure IL which is then converted to machine code by the CLR.
Unlike C# (or any other .NET language I know of), it can also produce 'mixed mode' assemblies which consist partly of IL and partly of native code. This gives you the best of both worlds and it's sometimes used to wrap unmanaged code within a managed wrapper which can then be consumed by other 'easier' .NET languages such as C# or VB.NET.
SenthilkumarPosted Mar 25, 2012, 2:49 AM
The C# is part of the Microsoft .Net framework and it supports 44 languages. It needs common environment and common format to execute the code. Microsoft decided to convert all the language code into common code is called Micorosoft Intermediate Language(MSIL). Which will be executed and loaded by the CLR at the time of running.
The IL code is understandable by the compiler to execute all the .net supported language and which runs under the CLR to enable auto memory management called Garbage collection.
The C++ was designed and execute it on its own compiler and which was not designed to compile and execute the code written on other languages. Thats why C++ has converted into own execution language.
I hope this will help you to understand this.
Sam HobbsPosted Mar 25, 2012, 2:20 AM
Why does the Java compiler convert Java code to Java bytecode?
Why does a microwave oven make heat instead of pictures? A microwave oven is used to cook things but not to watch videos.
Many people are going to tell you that C# is better; that it is newer and therfore it is better. Then other people might say that C++ is better. They both have advantages. Many people will tell you that Java is better. But Java is older than .Net.
C++ and C# are different. If you need to know which one is better, you must specify what you mean by "better". C++ is better for some things and C# is better for other things.