Relay-Version: version B 2.10 5/3/83; site utzoo.UUCP Path: utzoo!mnetor!seismo!rutgers!princeton!allegra!alice!shopiro From: shopiro@alice.UUCP Newsgroups: comp.lang.c Subject: Re: Function prototypes versus open() Message-ID: <7046@alice.UUCP> Date: Wed, 1-Jul-87 16:41:20 EDT Article-I.D.: alice.7046 Posted: Wed Jul 1 16:41:20 1987 Date-Received: Fri, 3-Jul-87 04:24:19 EDT References: <18346@ucbvax.BERKELEY.EDU> <8042@utzoo.UUCP> <2210@hoptoad.uucp> <657@haddock.UUCP> Organization: AT&T Bell Laboratories, Murray Hill NJ Lines: 12 Summary: C++ function prototype with default argument solves the problem I'd just like to mention that in C++, the prototype for open() would be int open(const char* path, int flags, int mode=0); This declares a function with three arguments, that can optionally be called with only two arguments. In that case, the compiler adds the third argument using the default value given in the declaration. Thus old code coexists with new, and type checking is not defeated. -- Jonathan Shopiro AT&T Bell Laboratories, Murray Hill, NJ 07974 research!shopiro (201) 582-4179