Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Why is the executable(.exe file) file has a size greater than the compiled .C file? [closed]

Tags:

c

size

Just out of curiosity, i wanted to know why are my compiled .C files(approx 2-5 kb) are smaller in size than my executable(.exe) files(130-200 kb)?

like image 626
poorvank Avatar asked Feb 16 '23 08:02

poorvank


1 Answers

You compiler source file is just the generated code from the actual source file and not much else. An executable have been linked with other object files and libraries, needed for all external functions and variables you need. That of course makes the executable much bigger as it contains much more code.

like image 62
Some programmer dude Avatar answered Apr 27 '23 21:04

Some programmer dude