Problem returning doubles from a function

Farrell Woods ftw at masscomp.UUCP
Mon Mar 27 04:49:10 AEST 1989


In article <39722 at csvax1.cs.tcd.ie> omahony at csvax1.cs.tcd.ie (Donal O'Mahony - OMAHONY at 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 at masscomp.com
1 Technology Way				uucp:   {backbones}!masscomp!ftw
Westford, MA 01886				OS/2:   Half an operating system



More information about the Comp.lang.c mailing list