Relay-Version: version B 2.10 5/3/83; site utzoo.UUCP Path: utzoo!mnetor!uunet!husc6!cmcl2!brl-adm!adm!RMANGALD%CLARKU.BITNET@wiscvm.wisc.EDU From: RMANGALD%CLARKU.BITNET@wiscvm.wisc.EDU Newsgroups: comp.lang.c Subject: VAX/VMS C and Message-ID: <9226@brl-adm.ARPA> Date: Thu, 10-Sep-87 14:40:46 EDT Article-I.D.: brl-adm.9226 Posted: Thu Sep 10 14:40:46 1987 Date-Received: Sun, 13-Sep-87 09:19:48 EDT Sender: news@brl-adm.ARPA Lines: 60 Listmember Paul Winalski (winalski%psw.dec@decwrl.dec.com) writes: >[offers solution to someone's problem passing arguments to a UIS >routine] ...VAX C floating point constants are of type double, not >type float (see "Guide to VAX C", Section 6.4.1, Floating-Point >Constants).... The VAX C manual offers a rather strange (to me) solution to the problem of preventing the automatic conversion of to . It suggests using a structure, as in: void main() { struct foo { float n; } bar; void f(); bar.n = 3.14; /* or whatever */ f(bar); } Here, is a function that expects a single argument passed by value, like some of the library functions that expect one or more F-floating arguments. What appears strange to me is: Why go to all this trouble when you can use a cast, as in: void main() { float n; void f(); f((float) n); } Is there something wrong with my approach? The "struct" approach looks awfully inelegant to me. >...I don't think function prototypes were implemented in VAX C at the >time that UISENTRY.H was written. Could someone explain what "function prototypes" are? I've heard a lot about these recently. Thanks. Rahul. -------------------------------- Rahul Mangaldas (rmangaldas@clarku.bitnet) Box 1311, Clark University 950 Main Street Worcester, MA 01610-1477