Path: utzoo!attcan!uunet!clyde.concordia.ca!jarvis.csri.toronto.edu!mailrus!uwm.edu!srcsip!jhereg!mark From: mark@Jhereg.Minnetech.MN.ORG (Mark H. Colburn) Newsgroups: comp.lang.c Subject: Re: Prototypes with old style definitions Message-ID: <1990Feb13.133503.19793@Jhereg.Minnetech.MN.ORG> Date: 13 Feb 90 13:35:03 GMT References: <626@cameron.cs.duke.edu> <2329@dataio.Data-IO.COM> Organization: Open Systems Architects, Inc., Mpls, MN Lines: 36 In article <2329@dataio.Data-IO.COM> bright@Data-IO.COM (Walter Bright) writes: >In article <626@cameron.cs.duke.edu> amr@dukee.egr.duke.edu (Anthony M. Richardson) writes: << float foo(float, int); << << float foo(x, n) << float x; << int n; << { ......... } <"Syntax error!" But seriously, the second definition is equivalent to: < < float foo(tmp,n) < double tmp; < int n; < { float x = tmp; < .... < } I was under the impression that the standard allowed parameters to be passed between functions without type coersion in this manner as long as there was a function prototype in effect. If no function prototype is in effect then the second example would be correct. However, using prototypes, the former should be correct. If you wanted doubles passed, you could always do: double foo(double, int); double foo(double x, int n) { ... }; -- Mark H. Colburn mark@Minnetech.MN.ORG Open Systems Architects, Inc.