Why c++ is faster than c# | Sololearn: Learn to code for FREE!
Novo curso! Todo programador deveria aprender IA generativa!
Experimente uma aula grƔtis
+ 2

Why c++ is faster than c#

I have heard that c++ is faster than many others programming languages ( like C# ), but why ? Both are compiled so they must be same

24th Dec 2018, 10:17 PM
Chalza
Chalza - avatar
3 Respostas
+ 3
C# is similar to Java. They are compiled in a intermediate code, then the intermediate code is translate to machine code. For Java JVM, for C#. Net. Instead C++ is compiled directly in Machine Code. So C++ is "real" compiled language, Java and C#, not. This is why Java and C# have similar speed and are a lot of slower than C++ (for large projects).
25th Dec 2018, 12:52 AM
RoboCybernetic
RoboCybernetic - avatar
+ 3
Both are compiled but C# is compiled into code for another runtime environment (. net) and c++ ist compiled into native code for a very specific processor architecture.
25th Dec 2018, 12:10 AM
Uglycut
Uglycut - avatar
+ 2
so in c# there is another processing layer in between.
25th Dec 2018, 12:13 AM
Uglycut
Uglycut - avatar