Path: utzoo!utgpu!news-server.csri.toronto.edu!bonnie.concordia.ca!uunet!elroy.jpl.nasa.gov!swrinde!zaphod.mps.ohio-state.edu!rpi!uupsi!grebyn!jmbj From: jmbj@grebyn.com (Jim Bittman) Newsgroups: comp.os.msdos.programmer Subject: General 'C' Preprocessor Question Keywords: Variable number of arguments Message-ID: <1991Feb26.082837.5618@grebyn.com> Date: 26 Feb 91 08:28:37 GMT Organization: Grebyn Corporation Lines: 15 Is it possible to use the preprocessor to handle a variable number of arguments? Let's say that I want to redefine "printf" to "sprintf". Is this possible? #define printf(a) sprintf(mychbuf,a) This works just fine if there are no arguments, such as: printf("Hello World\n"); This correctly processes to: sprintf(mychbuf,"Hello World\n"); I have checked the literature, but nothing seems to touch on this subject. Please post or e-mail any responses, I read this group religously, and really like it! Thank you. Jim Bittman, jmbj@grebyn.com