Path: utzoo!attcan!uunet!husc6!bloom-beacon!tut.cis.ohio-state.edu!rutgers!bellcore!faline!thumper!ulysses!attibr!vch From: vch@attibr.UUCP (Vincent C. Hatem) Newsgroups: comp.lang.c Subject: Re: Can ANYONE tell me why this code snippet doesn't work?? Summary: hmm... Message-ID: <57@attibr.UUCP> Date: 17 Oct 88 18:59:06 GMT References: <7778@gryphon.CTS.COM% Organization: AT&T International, Basking Ridge, NJ Lines: 37 In article <7778@gryphon.CTS.COM%, rickf@pnet02.cts.com (Rick Flower) writes: % I've been trying to get the following code to work.. I've tried just about % everything that I could think of (along the lines of modifications). All I'm % trying to do is write a different printf routine to route information through % a window text printing routine... If anyone can help me, let me know.. % % ----------------------------------------------------------------------------- % void Test(fmt,args) % char *fmt; % unsigned *args; % { % char buff[129]; % % sprintf(buff,fmt,args); % printf("%s\n",buff); % } % % main() % { % Test("%d %d %d %d",10,20,30,40); % } You aren't passing a POINTER to the arguments, as you seem to think you are. this should be (if I'm not mistaken... i haven't tried this lately) unsigned *args; sprintf(buff,fmt,&args); ^ ! -Vince -- Vincent C. Hatem | att ---->\ (available from any AT&T International | ulysses ->\ Action Central site) International Operations Technical Support | bellcore ->\ 1200 Mt Kemble Ave, Basking Ridge, NJ 07920 | ihnp4 ----->\__ !attibr!vch