Question: My executable was 364KB in size. It did not use a Vector2D class so I implemented one with overloaded operators.

I changed most of my code from

```
point.x = point2.x;
point.y = point2.y;

```

to 

```
point = point2;

```

This resulted in removing nearly 1/3 of my lines of code and yet my exe is still 364KB. What exactly causes it to grow in size?

Answer: 
When you compile a c or c++ program into an executable, the compiler translates your code into machine code, and applying optimizations as it sees fit.
But simply, more code = more machine code to generate = more size to the executable.
Also, check if you have lot of static/global objects. This substantially increase your exe size if they are not zero initialized. 

For example:

```
int temp[100] = {0};
int main()
{

}

```

size of the above program is 9140 bytes on my linux machine. 

if I initialize temp array to 5, then the size will shoot up by around 400 bytes. The size of the below program on my linux machine is 9588.

```
int temp[100] = {5};
int main()
{

}

```

This is because, zero initialized global objects go into .bss segment, which ill be initialized at once during program startup. Where as non zero initialized objects contents will be embedded in the exe itself.