On 06/02/2017 11:47 AM, bob by wrote: > Wonder why including <iostream> bloats my exe file so much (extra 900 KiB, > with statically linked libraries), even if nothing from there is used. Why > cout requires so much code. >
It includes static initializer code to initialize all the std::* members, so you are increasing code size by merely including the header. > I downloaded gcc-6.3.0 source code, and found libstdc++-v3\src\c++11 > folder. I guess the "cout <<" is somewhere in here, but I'm not sure where > to look. Here is the full function name that my debugger is looking for: > > std::basic_ostream<char, std::char_traits<char> >& std::operator<< > <std::char_traits<char> >(std::basic_ostream<char, std::char_traits<char> >> &, char const*) > > Can somebody here write a replacement for the standard cout, that will be > able to print strings and integers, and internally will just redirect to > puts and itoa? I'm only starting with C++, I'm not sure how to do it. I suppose you want to just use printf.
signature.asc
Description: OpenPGP digital signature
------------------------------------------------------------------------------ Check out the vibrant tech community on one of the world's most engaging tech sites, Slashdot.org! http://sdm.link/slashdot
_______________________________________________ Mingw-w64-public mailing list [email protected] https://lists.sourceforge.net/lists/listinfo/mingw-w64-public
