Quantcast
Channel: Active questions tagged gcc - Stack Overflow
Viewing all articles
Browse latest Browse all 22070

c binary file greater than source file [duplicate]

$
0
0

This question already has an answer here:

I have a c source file with name simple.c (file size 68 bytes) and I compiled it using gcc. The output binary file size is 7151 bytes.

C Source code:

int main()
{
    int a = 10;
    int b = 34;
    int c = a + b;
    return c;
}

I haven't included any header files.

I don't know, how does the C binary file becomes bigger than the source file. Can anyone please explain?

test@test-desktop:~/Desktop/c$ ls -l
total 4
-rw-rw-r-- 1 test test 68 Jul 15 15:04 simple.c
test@test-desktop:~/Desktop/c$ gcc simple.c 
test@test-desktop:~/Desktop/c$ ls -l
total 12
-rwxrwxr-x 1 test test 7151 Jul 15 15:04 a.out
-rw-rw-r-- 1 test test   68 Jul 15 15:04 simple.c

The above is the terminal output.


Viewing all articles
Browse latest Browse all 22070

Trending Articles



<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>