Path: utzoo!utgpu!jarvis.csri.toronto.edu!mailrus!csd4.milw.wisc.edu!lll-winken!uunet!mcvax!ukc!tcdcs!csvax1!omahony From: omahony@csvax1.cs.tcd.ie (Donal O'Mahony - OMAHONY@cs.tcd.ie) Newsgroups: comp.lang.c Subject: Problem returning doubles from a function Message-ID: <39722@csvax1.cs.tcd.ie> Date: 22 Mar 89 18:37:02 GMT Organization: Computer Science Department, Trinity College Dublin Lines: 27 Can anone explain the problem with the following program (made up of 2 files). ::main.c #include main() {double a,b; a = 1.234; b = store_length(a); printf("b=%f\n",b); } ::rt1.c double store_length( double measurements) { measurements= 2; printf("Returning measurements=%f\n",measurements); return(measurements); } When these two programs are linked and run, they do not print 'b=2,' as I would expect. Why? -- _______________________________________________________________________ Donal O'Mahony omahony@cs.tcd.ie Computer Science Dept., Trinity College, Dublin 2, Ireland _______________________________________________________________________