Path: utzoo!utgpu!news-server.csri.toronto.edu!cs.utexas.edu!sdd.hp.com!samsung!uunet!bellcore!taffy.bellcore.com!mlw From: mlw@taffy.bellcore.com (Mary Lu Wason) Newsgroups: comp.lang.c Subject: my_printf calling printf Message-ID: <1991Feb28.110727@taffy.bellcore.com> Date: 28 Feb 91 16:07:27 GMT Sender: usenet@bellcore.bellcore.com (Poster of News) Reply-To: mlw@elvislu.soac.bellcore.com Organization: Bell Communications Research Lines: 26 You can try this: my_printf(debug,format,a,b,c,d,e,f,g,h,i,j,k) int debug; char *format; int a,b,c,d,e,f,g,h,i,j,k; { if(debug){ fprintf(stderr,"MYDBG:"); fprintf(stderr,format,a,b,c,d,e,f,g,h,i,j,k); } } This works on both Unisys and MVS. Yes, a - k can be longs and chars etc. printf uses the format string to figure what they are. printf doesn't look for any more arguments than are in the format string. Of course, for this you have to take a guess as to how many arguments will be used. -Mary Lu