Path: utzoo!attcan!uunet!aplcen!uakari.primate.wisc.edu!dali.cs.montana.edu!milton!unicorn!n8742883 From: n8742883@unicorn.WWU.EDU (Perry Pederson) Newsgroups: comp.sys.atari.st Subject: Laser C function call help needed! (slightly long) Keywords: Laser C, help! Message-ID: <1213@unicorn.WWU.EDU> Date: 12 Jul 90 08:40:18 GMT Reply-To: n8742883@unicorn.WWU.EDU (Perry Pederson) Organization: Western Washington Univ, Bellingham, WA Lines: 75 I have just purchased Laser C, and after a week of book hunting was able to purchase a copy of "The C Programming Language", second edition, by B. Kernighan and D. Ritchie. I was advised to buy this book as I was told it was the "bible" for C. I was learning a lot of the basic functions of C and having a pretty good time learning the language until I hit the section on functions. It appears to me that Laser C is _not_ ANSI compatible, which really burns me. I got massive syntax errors when I tried to compile a simple function. The next page (p.26) the authors showed a "note of history" where "The biggest change between ANSI C and earlier versions is how functions are declared and defined...." and gave an example of a function "would have been written" in the older versions of C. I wrote the old version in and it compiled and ran perfectly. Satisfied that I could overcome a small syntactical problem with the language, I went off to the next example which has an array passed to a function, and the function returns an integer value. The compiler hated it. I have tried for an hour to juggle the syntax around, but it still won't compile at all. The algorithm is as follows as per the book: /* getline: read a line into s, return length */ int getline(char s[], int lim) { int c,i; for (i=0; i