Path: utzoo!utgpu!news-server.csri.toronto.edu!mailrus!uwm.edu!rpi!zaphod.mps.ohio-state.edu!sdd.hp.com!decwrl!nsc!pyramid!athertn!alex From: alex@athertn.Atherton.COM (Alex Leavens) Newsgroups: comp.sys.atari.st Subject: Re: Laser C function call help needed! (slightly long) Keywords: Laser C, help! Message-ID: <27048@cherry.athertn.Atherton.COM> Date: 13 Jul 90 18:55:09 GMT References: <1213@unicorn.WWU.EDU> Reply-To: alex@Atherton.COM (Alex Leavens) Organization: Atherton Technology, Sunnyvale, CA Lines: 46 Perry Pederson asks: > First question: How does one pass variables to a function in >Laser C, and how do you declare that the function will return a >certain type? > I have tried to 'mimic' their >example of 'older' versions of C programming by declaring the >variables under the function declaration and removed the beginning >'int', thus reading: >/* getline; read a line into s, return length */ >getline(s, lim) >char s[], int lim; >{ > etc. etc. etc. >} Your example should read as follows: getline(s, lim) char s; int lim; { stuff here } The problem with your example is that you have a comma following the definition of s[], not a semi-colon. That ain't Laser C's fault, that's the C language--you canna do that, lad. I don't know if Laser C has an ANSI upgrade--Mark Williams has been promising one for a while, but so far has pooped out on actually producing it.... -- |-------------------------------------------------------------------------| |--alex | alex@Atherton.COM | Caution! Falling Opinions, next 6 miles | | New Net Address!!: UUCP: {uunet,ucbvax}!unisoft!bdt!dsdeng!alex | | "AAAAAGH! It's Friday the 13th!!! |