unless the C++ libraries are manually edited to only include what
you need, its almost impossible to get a Win32 program which is
only 5k.
No crt library! no Icon's or resources, exception handling turned off & buffer checking off.
This does however mean that you have to do your own memory managment(you can still override new & delete.) Global constructors will not be initialized.
but it is doable, there are restrictions but you can still do a lot.
Some of those restrictions (eg global objects not being initialised) mean that you may be using a C++ compiler, but the code is far removed from being C++.
There comes a point when, if you tweak compiler settings enough, a compiler for language X becomes a compiler for a language Y that has similar syntax but is actually very different.
Well, my biggest C GUI was several thousand lines -- actually, the source code is about 95k. Took me a long time.
The executable is 80k, and it's not really "trivial", either (there's a text area, buttons, menus, layered regular expression searching, a local socket server, input processing, hyperlinking, etc). I'm guessing if I had used C++ and the STL, the code base would be somewhat smaller but the executable would quadruple in size, at least.
Last edited by MK27; 04-09-2010 at 07:33 AM.
C programming resources:
GNU C Function and Macro Index -- glibc reference manual
The C Book -- nice online learner guide
Current ISO draft standard
CCAN -- new CPAN like open source library repository
3 (different) GNU debugger tutorials: #1 -- #2 -- #3
cpwiki -- our wiki on sourceforge