Path: utzoo!utgpu!news-server.csri.toronto.edu!bonnie.concordia.ca!uunet!stanford.edu!neon.Stanford.EDU!mrhoten From: mrhoten@neon.Stanford.EDU (Matthew Paul Rhoten) Newsgroups: comp.lang.c Subject: Re: Float problems Summary: testfloat() Keywords: function calls need parentheses Message-ID: <1991May25.234943.7283@neon.Stanford.EDU> Date: 25 May 91 23:49:43 GMT References: <1991May25.213301.13765@cs.mcgill.ca> Organization: Computer Science Department, Stanford University Lines: 26 In article <1991May25.213301.13765@cs.mcgill.ca> storm@cs.mcgill.ca (Marc Wandschneider) writes: >#include >float testfloat (void); >[...] > f = testfloat; >[...] The problem is that parentheses are needed in a call to a function with a void argument list. When I try and compile the code above, I get "Illegal pointer arithmetic" or some such - because when I give the compiler the token "testfloat" it matches it with a pointer-type. I think the interpretation of the error is implementation-dependent. To call the function, simply include an empty set of parentheses after the function's name: f = testfloat(); This will work quite nicely. At least it did on my compiler. Hope this helps. -matt -- Matt Rhoten | PO Box 10031 | Standard disclaimers apply. mrhoten@cs.stanford.edu | Stanford, CA 94309 | (415) 497-2853 | veni vidi vomui