From owner-freebsd-chat Sun Sep 6 17:23:54 1998 Return-Path: Received: (from majordom@localhost) by hub.freebsd.org (8.8.8/8.8.8) id RAA15784 for freebsd-chat-outgoing; Sun, 6 Sep 1998 17:23:54 -0700 (PDT) (envelope-from owner-freebsd-chat@FreeBSD.ORG) Received: from allegro.lemis.com (allegro.lemis.com [192.109.197.134]) by hub.freebsd.org (8.8.8/8.8.8) with ESMTP id RAA15779 for ; Sun, 6 Sep 1998 17:23:50 -0700 (PDT) (envelope-from grog@freebie.lemis.com) Received: from freebie.lemis.com (freebie.lemis.com [192.109.197.137]) by allegro.lemis.com (8.9.1/8.9.0) with ESMTP id JAA18827; Mon, 7 Sep 1998 09:53:19 +0930 (CST) Received: (from grog@localhost) by freebie.lemis.com (8.9.1/8.9.0) id JAA28452; Mon, 7 Sep 1998 09:53:18 +0930 (CST) Message-ID: <19980907095317.L25397@freebie.lemis.com> Date: Mon, 7 Sep 1998 09:53:17 +0930 From: Greg Lehey To: Jens Schweikhardt , Charles Youse Cc: syko@sykotik.org, scott@iprg.nokia.com, daniel@cooltime.simplenet.com, freebsd-chat@FreeBSD.ORG Subject: Re: Where can I find C References: <199809061040.MAA17606@obsidian.noc.dfn.de> Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii X-Mailer: Mutt 0.91.1i In-Reply-To: <199809061040.MAA17606@obsidian.noc.dfn.de>; from Jens Schweikhardt on Sun, Sep 06, 1998 at 12:40:06PM +0200 WWW-Home-Page: http://www.lemis.com/~grog Organization: LEMIS, PO Box 460, Echunga SA 5153, Australia Phone: +61-8-8388-8286 Fax: +61-8-8388-8725 Mobile: +61-41-739-7062 Sender: owner-freebsd-chat@FreeBSD.ORG Precedence: bulk X-Loop: FreeBSD.org (redirected to -chat) On Sunday, 6 September 1998 at 12:40:06 +0200, Jens Schweikhardt wrote: > # On Sat, 5 Sep 1998, Dusk Auriel Sykotik wrote: > # > On Fri, 4 Sep 1998, Scott Sewall wrote: > # > > main () { > # > > printf("Hello World!\n"); > # > > } > # > You can't use printf(), you didn't include stdio.h :) > > hello, world\n > > # Nah, it'll draw a warning, perhaps .... but this is perfectly legal C. > > What did you smoke tonight? :-) K&R fiirst edition? > You call a variadic function with no prototype in scope > which leads to undefined behaviour as per ISO 9899:1990 > This bombs as soon as the representation of int and char * > are different or if there are different passing mechanisms > for those types. You're obviously very young, or you place too much trust in ``standards''. The *very* first program in "The C programming language", by Brian W. Kernighan and Dennis M. Ritchie, first edition (1978), page 6, is: main() { printf("hello, world\n"); } That's all. No header files, no comments. Purists will note that the the braces are not in K&R style (they are in the previous example), that the message is lower case only and does not bang. > Note that only the spelling of hello, world\n as above is correct :-) I didn't think it was standardized. Greg -- See complete headers for address, home page and phone numbers finger grog@lemis.com for PGP public key To Unsubscribe: send mail to majordomo@FreeBSD.org with "unsubscribe freebsd-chat" in the body of the message