🚀 go-pugleaf

RetroBBS NetNews Server

Inspired by RockSolid Light RIP Retro Guy

Article View: comp.os.msdos.misc
Article #3527

Re: MY SCREWUP.. ok ok ok... get off it dudes

#3527
From: Keith Jackson
Date: Wed, 26 Jun 1991 19:47
42 lines
2225 bytes
In article <1991Jun24.091147.29839@midway.uchicago.edu> valley@gsbsun.uchicago.edu (Doug Dougherty) writes:
>roy%cybrspc@cs.umn.edu (Roy M. Silvernail) writes:

>>matelgar@nmsu.edu (Marek Telgarsky) writes:

>>> I changed it so that it just writes Hello
>>> World! on the screen .. The most basic of C programs.. ok? 
>>> /***********************************************************************/
>>> main() {			/* matelgar@dante.nmsu.edu */
>>>   printf("Hello World!\n");	
>>> }

Not the most basic (see example below...)

>>Methinks you left out something quite important, though...

>>#include <stdio.h>
>^^^^^^^^^^^^^^^^^^^

>What makes you think you need that?
>Methinks you are someone who is doing *training* for C coding, not
>someone who is actually doing C coding.

You technically _don't_ need the #include, BUT, it's VERY good programming
practice.  Helps to avoid calling convention problems (for ANSI and later)
plus, gives you access to #defines (like NULL for example!), structs,
typdefs, extern variables, etc.  Anyone who want's to do a good job of C
coding will include the appropriate header files to be safe.  The only
thing you gain by omitting them is compile time.

Now, the most simple C program is:

main(){write(1,"hello, world!\n",14);}

This requires the least amount of linking and produces the same result.  Of
course, one has to count the number of characters in the string, but at
least you save the computer from having to do such an arduous task. :-)

  -*^*-*^*-*^*-*^*-*^*-*^*-*^*-*^*-*^*-*^*-*^*-*^*-*^*-*^*-*^*-*^*-*^*-*^*-
		Keith Jackson == jackson@csvax.seas.smu.edu

                          UN*X - live free or die
Technical Details
Message-ID: <18982@smunews.UUCP>
Path: arc1-ca.pugleaf.net!utzoo!utgpu!news-server.csri.toronto.edu!rpi!usc!cs.utexas.edu!milano!bigtex!texsun!smunews!kej
References: <MATELGAR.91Jun23114843@dante.nmsu.edu> <6m5144w164w@cybrspc> <1991Jun24.091147.29839@midway.uchicago.edu>

Show Full Headers
Complete Article Headers
Path: arc1-ca.pugleaf.net!utzoo!utgpu!news-server.csri.toronto.edu!rpi!usc!cs.utexas.edu!milano!bigtex!texsun!smunews!kej
From: kej@smunews.UUCP (Keith Jackson)
Newsgroups: comp.os.msdos.misc
Subject: Re: MY SCREWUP.. ok ok ok... get off it dudes
Message-ID: <18982@smunews.UUCP>
Date: 26 Jun 91 19:47:47 GMT
References: <MATELGAR.91Jun23114843@dante.nmsu.edu> <6m5144w164w@cybrspc> <1991Jun24.091147.29839@midway.uchicago.edu>
Reply-To: jackson@csvax.seas.smu.edu (Keith Jackson)
Organization: S.M.U. alumn ; Dallas, TX
Lines: 42