home *** CD-ROM | disk | FTP | other *** search
/ NetNews Usenet Archive 1992 #31 / NN_1992_31.iso / spool / comp / lang / c / 19062 < prev    next >
Encoding:
Text File  |  1992-12-31  |  1.2 KB  |  56 lines

  1. Path: sparky!uunet!spool.mu.edu!uwm.edu!linac!att!att!allegra!alice!bs
  2. From: bs@alice.att.com (Bjarne Stroustrup)
  3. Newsgroups: comp.lang.c
  4. Subject: Re: Parameter passing & data abstraction
  5. Message-ID: <24524@alice.att.com>
  6. Date: 31 Dec 92 05:18:48 GMT
  7. Article-I.D.: alice.24524
  8. References: <1992Dec30.184135.1963@organpipe.uug.arizona.edu>
  9. Organization: AT&T Bell Laboratories, Murray Hill NJ
  10. Lines: 44
  11.  
  12.  
  13.  
  14. dave@cs.arizona.edu (Dave Schaumann @ University of Arizona) writes
  15.  
  16.  > Another would be to switch to C++, but I'm not especially keen to do that,
  17.  > in part because the resulting executable (at least for g++) tend to be
  18.  > 300+K in size, even for fairly simple programs.
  19.  
  20. That cannot be a C++ problem. For
  21.  
  22.     #include <stdio.h>
  23.  
  24.     main()
  25.     {
  26.         printf("Hello, World\n");
  27.     }
  28.  
  29. I get 
  30.  
  31.     text    data    bss    dec    hex
  32.     12288    6144    7624    26056    65c8
  33. when compiling as a C++ program, and
  34.  
  35.     text    data    bss    dec    hex
  36.     12288    6144    7612    26044    65bc
  37.  
  38. when compiling as a C program. Changing the example to use
  39. specific C++ facilities
  40.     
  41.     #include <iostream.h>
  42.  
  43.     main()
  44.     {
  45.         cout << "Hello, World\n";
  46.     }
  47.  
  48. I get
  49.  
  50.     text    data    bss    dec    hex
  51.     17408    2048    0    19456    4c00
  52.  
  53.  
  54. Ofcourse G++ may be different, but that difference ought to
  55. show up in GNU C also, then
  56.