TIP: Click on subject to list as thread! ANSI
echo: nthelp
to: Geo
from: Tony Williams
date: 2004-10-25 15:58:06
subject: Re: Organizing source code

From: Tony Williams 

On 10/24/2004 07:35 PM, Geo wrote:
> "Paul Ranson"  wrote in message
> news:417bd171$1{at}w3.nls.net...
>
>
>>If you look at the assembly language output from your C++ compiler you'll
>>see that your entire program is devoted to printing two pre-calculated
>>constants.
>
>
> 193K executable?
>
> Let me put this in perspective. When I used to do things in assembler, the
> disk size was 128K, this program would not even have fit on a single sided
> Apple }{ floppy disk.
>
> So what's the other 192K, a life support system?

In a sense, yes. It's likely to be the exception handling code hauled in by
using iostream.

For fun, I compiled your test on Linux and also a variant that uses
printf() instead of cout :

#include 
  int main()
  {
   double a, b;
   a=15/2;
   b=15.0/2;
   printf("%f %f\n", a, b);
   return 0;
  }

Here are the sizes :

13614 iotest_c*
66528 iotest_cpp*

C++ carries a lot of overhead.

--
Tony

--- BBBS/NT v4.01 Flag-5
* Origin: Barktopia BBS Site http://HarborWebs.com:8081 (1:379/45)
SEEN-BY: 633/267 270 5030/786
@PATH: 379/45 1 396/45 106/2000 633/267

SOURCE: echomail via fidonet.ozzmosis.com

Email questions or comments to sysop@ipingthereforeiam.com
All parts of this website painstakingly hand-crafted in the U.S.A.!
IPTIA BBS/MUD/Terminal/Game Server List, © 2025 IPTIA Consulting™.