Path: utzoo!utgpu!news-server.csri.toronto.edu!clyde.concordia.ca!uunet!mcsun!ukc!warwick!nott-cs!masalla.fulcrum.bt.co.uk!beta.its.bt.co.uk!john From: john@its.bt.co.uk (John Trickey) Newsgroups: comp.sys.atari.st Subject: Re: Laser C function call help needed! (slightly long) Keywords: Laser C, help! Message-ID: <4&Y$^L-@masalla.fulcrum.bt.co.uk> Date: 19 Jul 90 12:26:44 GMT References: <1213@unicorn.WWU.EDU> Sender: root@fulcrum.bt.co.uk (Root on Masalla) Organization: BT Applied Systems, Birmingham, UK Lines: 38 In article <1213@unicorn.WWU.EDU> n8742883@unicorn.WWU.EDU (Perry Pederson) writes: > >int getline(char s[], int lim) >{ Your array of char will have been pre-defined in some other part of the code by:- char string[strint_length]; so at this point you will be responding to a fn call of getline(string, string_limit); This means you need a "pointer to a char" and not an array in the fn definition which should be:- int getline(s,lim) char *s; int lim { These are interchangeable at reference time but not at definition time so the remainder of your code can remain the same ... except >getline(s, lim) >char s[], int lim; >{ This would not work as described before but in terms of C programming is a simple error. char a, b, c; is a single statement. If you tried char a, int, b; it would try to create a char variable called int if it did not get confused. To achieve your end you need two statements as in char s[]; int lim; I hope this has helped you to understand why your compiler complained. John -- John Trickey British Telecom Applied Systems. jvt@its.bt.co.uk ..!mcsun!ukc!axion!its G4REV @ GB7SUT Voice: +44 21 333 3369