I compiled two pieces of code using the Turbo C++ 3.0 and Borland C++ 5.02 compilers and came across some odd things. My two pieces of code are like these:
First piece of code
void main()
{
}
Second piece of code
#include <iostream.h>
#include <conio.h>
void main()
{
}
And I got these results from them:
- Borland C++ (first piece of code): 51 KB
- Borland C++ (second piece of code): 51 KB
- Turbo C++ (first piece of code): 5.89 KB
- Turbo C++ (first piece of code): 16.3 KB
I checked two Borland executable files with a hexadecimal viewer and realized they were exactly the same.
I examined the first piece of code from these compilers in IDA Pro and came across these graphs:
Turbo C++
Borland C++
Now I have these questions I'd like you to answer:
Why are Borland C++ compiled files the same when one of them clearly doesn’t have some include and another have?
Why are Borland C++ compiled files that big? (nearly 10 times bigger) and what is compiled that have that much size?
When I submit the first piece of code to this site, I can see the assembly code of the simple void main function and I realized that Borland C++ code is very much the same, but Turbo C++ assembly code is very very complicated and isn't the same. Why?
Why does this simple code, that compiled with Turbo C++, create these many functions that you can see in it's graph?