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?
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.
This site uses cookies to help personalise content, tailor your experience and to keep you logged in if you register.
By continuing to use this site, you are consenting to our use of cookies.