Path: utzoo!utgpu!jarvis.csri.toronto.edu!mailrus!bbn!ulowell!masscomp!ftw From: ftw@masscomp.UUCP (Farrell Woods) Newsgroups: comp.lang.c Subject: Re: Problem returning doubles from a function Message-ID: <1339@masscomp.UUCP> Date: 26 Mar 89 18:49:10 GMT References: <39722@csvax1.cs.tcd.ie> Reply-To: ftw@quasar.masscomp.UUCP (Farrell Woods) Organization: Concurrent Computer Corporation - Westford, Ma Lines: 17 In article <39722@csvax1.cs.tcd.ie> omahony@csvax1.cs.tcd.ie (Donal O'Mahony - OMAHONY@cs.tcd.ie) writes: >Can anone explain the problem with the following program (made up of >2 files). I forgot to mention: the returned type of ``store_length'' is supposed to be of type double, but since that fact is not mentioned in main.c, the compiler assumes it's return type to be int. Sticking a prototype in main.c before you use store_length would be the best solution. The argument passing in your example is still wrong, but it wasn't the reason you got answers which surprised you. -- Farrell T. Woods Voice: (508) 392-2471 Concurrent Computer Corporation Domain: ftw@masscomp.com 1 Technology Way uucp: {backbones}!masscomp!ftw Westford, MA 01886 OS/2: Half an operating system