🚀 go-pugleaf

RetroBBS NetNews Server

Inspired by RockSolid Light RIP Retro Guy

Article View: comp.lang.c.moderated
Article #2018

Re: Canocical hello world (was: Check if A-drive is ready)

#2018
From: Bill Mitchell
Date: Fri, 16 Feb 1996 06:13
32 lines
1410 bytes
in comp.lang.c.moderated, schweikh@itosun.ito.uni-stuttgart.de (Jens Schweikhardt) said:


>ObC: What is the canonical first program to write in C?  Is it
>
>	"Hello World\n" or
>	"Hello, world\n" or
>	"hello world\n" or what?
>
>Please cite authoritative sources or use statistics.

Quoting K&R1:

   The only way to learn a new programming language is by writing
   programs in it.  The first program to write is the same for all
   languages:

      Print the words
              hello, world

   [...]  In C, the program to print "hello, world" is

      main()
      {
          printf("hello, world\n");
      }

K&R2 adds "#include <stdio.h>" to this program.  That addition should be
made if we're speaking of ANSI C (vs. traditional pre-ANSI X3.159-1989 C).

-- 
mitchell@mdd.comm.mot.com (Bill Mitchell)
Technical Details
Message-ID: <4g17ak$mvr@solutions.solon.com>
Path: arc1-ca.pugleaf.net!solon.com!not-for-mail
References: <4fstjt$2lp@solutions.solon.com> <4fu7sn$991@solutions.solon.com>

Show Full Headers
Complete Article Headers
Path: arc1-ca.pugleaf.net!solon.com!not-for-mail
From: mitchell@mdd.comm.mot.com (Bill Mitchell)
Newsgroups: comp.lang.c.moderated
Subject: Re: Canocical hello world (was: Check if A-drive is ready)
Date: 16 Feb 1996 00:13:40 -0600
Organization: Motorola - Wireless Data Group; Seattle, WA
Sender: clc@solutions.solon.com
Approved: clc@solutions.solon.com
Message-ID: <4g17ak$mvr@solutions.solon.com>
References: <4fstjt$2lp@solutions.solon.com> <4fu7sn$991@solutions.solon.com>
Reply-To: mitchell@mdd.comm.mot.com (Bill Mitchell)
NNTP-Posting-Host: solutions.solon.com