home *** CD-ROM | disk | FTP | other *** search
/ NetNews Usenet Archive 1993 #3 / NN_1993_3.iso / spool / comp / lang / cplus / 20006 < prev    next >
Encoding:
Text File  |  1993-01-28  |  1.8 KB  |  55 lines

  1. Path: sparky!uunet!tcsi.com!iat.holonet.net!news.cerf.net!usc!cs.utexas.edu!sun-barr!news2me.EBay.Sun.COM!male.EBay.Sun.COM!loopkill!pauln
  2. From: pauln@loopkill.EBay.Sun.COM (Paul Nguyen)
  3. Newsgroups: comp.lang.c++
  4. Subject: Re: Clashes between <stdarg.h> and <varargs.h>
  5. Date: 27 Jan 1993 18:33:27 GMT
  6. Organization: Sun Microsystems, Inc.
  7. Lines: 41
  8. Distribution: world
  9. Message-ID: <1k6khoINNqoi@male.EBay.Sun.COM>
  10. References: <1993Jan27.085907.894@walter.cray.com>
  11. Reply-To: pauln@loopkill.EBay.Sun.COM
  12. NNTP-Posting-Host: loopkill.ebay.sun.com
  13.  
  14. In article 894@walter.cray.com, ssh@cray.com (Steven Hein) writes:
  15. > I am writing a user interface in C++ using the XView toolkit.  But, I'm having a
  16. > problem using stdarg.h and varargs in the same source file (XView uses varargs and I
  17. > need to include some XView header files in this source).  Can anyone tell me:
  18. >     a) how to make stdarg and varargs cooperate in the same C++ source file
  19. >                 OR
  20. >     b) how to use varargs to implement a C++ member function declared like this:
  21. >             void xxx::output(char* fmt, ...);
  22. > I don't need to parse the argument list--I just need to pass it to vsprintf() or
  23. > to vfprintf().
  24. > Any help would be appreciated--I'm at my wit's end with this one...Also, I'm a newbie
  25. > with this 'news' thing, so please email me any suggestions so I'm sure to get them!
  26. > Thanks!
  27. > ----
  28. > Steve Hein
  29. > Cray Research, Inc.
  30. > tel.    (715) 726-5525
  31. > email:  ssh@cray.com
  32.  
  33. Steve,
  34.     I ran into the same problem when I was trying to create a constructor with
  35. variable argument lists.  My work around is below:
  36.  
  37. /* Variable args includes */
  38. #include <stdarg.h>
  39. #define  _sys_varargs_h                 /* prevent /usr/include/varargs.h */
  40. #define  VARARGSH                       /* prevent ...CC/incl/varargs.h */
  41.  
  42.  
  43. Paul
  44.  
  45.  
  46.