C++ executables all 38kb?

  • Thread starter Thread starter One
  • Start date Start date

One

One

Soldato
Joined
24 Aug 2011
Posts
6,162
Location
ABQ, NM
I'm just starting to learn C++ as something to do that's more productive than watching TV or playing games. All these simple programs I'm compiling are 38kb. Why is this?
 
No special reason.

Your compiler will produce the executable and will do various forms of optimization to produce the smallest binary it can. More code = more bytes (generally speaking...) :)
 
There will be a minimum file size, purely as your linking the libraries that are part of the executable. Any programs your writing right now will have little effect on the size as they will only be simple programs.
 
assuming you're not statically linking the standard library (otherwise your binary would be even bigger), it'll probably be due to things like iostreams, which causes lots of template instantiations.
 
Back
Top Bottom