On Sun, Feb 09, 2003 at 11:03:16AM +0100, Andreas Aardal Hanssen wrote:
> In general, I have seen that C++ code gets much bigger than C code, but
> I'm not quite sure why.
For one thing, every method call could be a lookup in a dynamic dispatch
table. By way of example, 'hello world' is 3964B stripped in C++ while only
2756B in C. The text segments of each have nearly the proprotional size
ratios as well (416B vs 272B).
Every line of C++ is more expressive and that expressiveness generally
translates into bigger object code. Initializers, constructors, etc.
Plus, of course, all the advanatages of the language being active at runtime.
Try catch blocks alone add a number of function calls and bookkeeping
operations.
C=)
--
--------------------------------------------------------------------------
Better the hard truth than the comforting fantasy. -- Carl Sagan
--------------------------------------------------------------------------
Caskey <caskey*technocage.com> /// TechnoCage Inc.
--------------------------------------------------------------------------
A presumption on your part does not constitute an obligation on my part.