home *** CD-ROM | disk | FTP | other *** search
- Path: news.crosslink.net!usenet
- From: vicky@steeds.com (Vicky Staubly)
- Newsgroups: comp.sys.amiga.programmer
- Subject: Re: simple K&R ANSI-C examples won't compile under SAS/C
- Date: 7 Mar 1996 03:58:03 GMT
- Organization: CrossLink Internet Services
- Message-ID: <4hlmsb$eod@zeus.crosslink.net>
- References: <68771782@0humpty.tomate.tng.oche.de>
- NNTP-Posting-Host: shire.steeds.com
- Mime-Version: 1.0
- Content-Type: text/plain; charset=iso-8859-1
- Content-Transfer-Encoding: 8bit
- X-NewsSoftware: GRn 2.1 Feb 19, 1994
-
-
- In article <68771782@0humpty.tomate.tng.oche.de> humpty@TOMATE.TNG.OCHE.DE (Andreas Mixich) writes:
- > this little example form the 'Kernighan&Ritchie' won't compile:
- >
- > #include <stdio.h>
- > #include <clib/alib_stdio_protos.h>
- >
- > main()
- > {
- > int c;
- >
- > while((c = GetChar()) !=EOF)
- > PutChar(c);
- > }
-
- Well, a couple things. First, you should be using "getchar()"
- and "putchar()" not "GetChar()" and "PutChar()". Yes, case
- matters.
-
- Secondly, stdio.h and clib/alib_stdio_protos.h define
- different versions of the same routines. stdlib.h defines
- the versions included by SAS in their c.lib... And
- clib/alib_stdio_protos.h defines the versions provided
- with the Amiga in amiga.lib... I usually use the SAS
- routines, especially for non-Amiga specific development
- (i.e. very portable software).
-
- So, change the routine names to lower case, and pick
- one of the include files, and try it then. Good luck!
-
- Vicky
-
- --
- Vicky Staubly Amiga 3000 owner vicky@steeds.com
- --
- "Software isn't released, it's allowed to escape."
-