home *** CD-ROM | disk | FTP | other *** search
- Newsgroups: comp.lang.c++
- From: nikki@trmphrst.demon.co.uk (Nikki Locke)
- Path: sparky!uunet!pipex!demon!trmphrst.demon.co.uk!nikki
- Distribution: world
- Subject: Re: using (...) question
- References: <1992Aug17.170733.17470@taumet.com>
- X-Mailer: cppnews $Revision: 1.14 $
- Organization: Trumphurst Ltd.
- Lines: 33
- Date: Wed, 19 Aug 1992 16:04:32 +0000
- Message-ID: <714265472snx@trmphrst.demon.co.uk>
- Sender: usenet@gate.demon.co.uk
-
-
- In article <1992Aug17.170733.17470@taumet.com> steve@taumet.com (Steve Clamage) writes:
-
- > >In <J3mkPB8w165w@toz.buffalo.ny.us> cyberman@toz.buffalo.ny.us (Cyberman) writes:
- >
- > >>I know printf is prototyped as
- > >>int printf(char *,...);
- > >>I would like to know how from within the function to access the
- > >>remaing parameters!
- >
- > The usual C implementations of <varargs.h> are not usable in C++, as
- > the macros result in illegal C++ code.
- >
- > The Standard C header file <stdarg.h> serves the same purpose and is
- > generally available with C++ implementations. The ANSI/ISO C++
- > committee has voted to make the Standard C header <stdarg.h> part of C++.
- >
- > If at all possible, you should use <stdarg.h> rather than <varargs.h>.
- > See any good Standard C text for information on the use of these macros.
- Correct. However, beware if you have a C++ -> C translator, and you are
- using certain flavours of Unix (at least one HP compiler to my knowledge),
- because there are bugs in the stdargs implementation.
-
- Of course, you should still use stdargs, and you should complain to your
- Unix vendor if the compiler is broken. I only mention it to save hours
- searching for a non-existent bug in your code, to hassle HP to fix their C
- compiler, and to show off my knowledge of obscure C compiler trivia :-)
- ---
- Nikki Locke | | nikki@trmphrst.demon.co.uk
- Trumphurst Ltd. | Tel: +44 (0)691-670318 | nikki@cix.compulink.co.uk
- PC and Unix consultancy | Fax: +44 (0)691-670316 | nikki@kewill.co.uk
- trmphrst.demon.co.uk is NOT affiliated with ANY other sites at demon.co.uk.
- Demon.co.uk is a dial-up subscription access point to the Internet.
-