Path: utzoo!utgpu!news-server.csri.toronto.edu!bonnie.concordia.ca!uunet!bu.edu!m2c!wpi.WPI.EDU!fenn From: fenn@wpi.WPI.EDU (Brian Fennell) Newsgroups: comp.lang.c Subject: Re: stdarg Message-ID: <1991Feb7.141828.18539@wpi.WPI.EDU> Date: 7 Feb 91 14:18:28 GMT References: <1991Feb5.145001.26837@hounix.uucp> <588@taumet.com> Organization: Worcester Polytechnic Institute Lines: 21 The answer to the original question appears to be, "You usually don't really need to, and here's how to fake it...." (See above) Here is an example of something that is not too far fetched that really does want 0 _fixed_type_ arguments. I am programming in X windows. most of the routines I use want to refer to a specific instance of a widget pseudo-object. This results in many lines that redundantly refer to the same widget, sometimes twenty lines in a row. I decide to use a global, much like printf uses a global called stdout. I have one routine that resets the one or two necessary parameters for the current widget, these might be integers, strings, or even in an unusual case doubles, depending on the class of my global. In this example (which I am currently working with in real life) the stdarg.h standard falls short of the vararg.h standard. Truth be told, I could use all pointers, but this makes using double constants such as M_PI a bit of a pain. I could also use a macro to pass the sizeof() as first argument but macros don't take variable number of arguments. Brian Fennell == fenn@wpi.wpi.edu