Path: utzoo!dptcdc!jarvis.csri.toronto.edu!ephemeral.ai.toronto.edu!bradb From: bradb@ai.toronto.edu (Brad Brown) Newsgroups: comp.std.c Subject: Variable arguments in macros Message-ID: <89Apr17.163342edt.11027@ephemeral.ai.toronto.edu> Date: 17 Apr 89 20:33:37 GMT Organization: Department of Computer Science, University of Toronto Lines: 24 I've been trying to find a way to have macros with variable numbers of arguments in ANSI C, and I don't think it can be done. I'm hoping that I'm wrong and that someone can tell me how to do it. What I'd like to do is have a header file with a macro similar to #define trace(s) { fprintf( stderr, s ); } and then call it like trace( "Entering zot(), arg is %d", arg ); or trace( "I'm here." ); If I could get the whole argument list to bind to s then everything would work. I can't do that, can I? Thanks for your help! (-: Brad Brown :-) bradb@ai.toronto.edu