home *** CD-ROM | disk | FTP | other *** search
/ NetNews Usenet Archive 1992 #18 / NN_1992_18.iso / spool / comp / lang / cplus / 12591 < prev    next >
Encoding:
Text File  |  1992-08-19  |  2.1 KB  |  47 lines

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