Path: utzoo!utgpu!news-server.csri.toronto.edu!mailrus!wuarchive!udel!haven!decuac!shlump.nac.dec.com!engage.enet.dec.com!ynotme.enet.dec.com!wallace From: wallace@ynotme.enet.dec.com (Ray Wallace) Newsgroups: comp.sys.atari.st Subject: Re: Laser C function call help needed! (slightly long) Message-ID: <1876@engage.enet.dec.com> Date: 12 Jul 90 21:36:59 GMT Sender: news@engage.enet.dec.com Organization: Digital Equipment Corporation Lines: 49 In article <1213@unicorn.WWU.EDU>, n8742883@unicorn.WWU.EDU (Perry Pederson) writes... > > 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 >/* getline; read a line into s, return length */ > >getline(s, lim) >char s[], int lim; >{ > etc. etc. etc. >} You can fix this one by changing the comma in the second line, to a semicolon. More commonly (I think) is to put the different types on seperate lines. Ie: char *s; int lim; > 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? Ahh, thats two questions? When you define a function, place only the variable names (not the types) inside the paranthesis (after the function name). To specify the data type returned by the function, just place the type in front of the function name. Ie: FILE fopen( name, mode ) char *name, *mode; /* The comma is correct here since both * variables are of the same type. */ { static FILE file1; etc. etc. etc. return &file1; } > > Second question: Is there a Laser C upgrade which meets the >ANSI standards? I have heard a lot of good stuff about this language I don't know the answer to that. > Thanx in advance to any Laser C 'experts' out there! I have never used Laser C, but you are welcom anyway :-) --- Ray Wallace (INTERNET,UUCP) wallace@oldtmr.enet.dec.com (UUCP) ...!decwrl!oldtmr.enet!wallace (INTERNET) wallace%oldtmr.enet@decwrl.dec.com ---