Is compiled code exactly the same as long as the programs do the same thing? | Sololearn: Learn to code for FREE!
New course! Every coder should learn Generative AI!
Try a free lesson
+ 2

Is compiled code exactly the same as long as the programs do the same thing?

Is the compiled code of 2 different sources codes that do exactly the same thing exactly the same, regardless of the language you use for the source code (C++, Java...)? What about 2 different programs in the same language

25th Aug 2017, 7:31 PM
Danilo
Danilo - avatar
1 Answer
+ 5
In general, no. Though I suppose it might depend on what exactly you mean by two programs that "do the same thing". If the source codes are different, then even if they give the same output for the same input, they are doing it in a different way, and the compiled codes will differ. For that matter, you can compile the same source code using different compiler options and that will give different resulting binaries.
26th Aug 2017, 5:09 AM
Erik