Can ANYONE tell me why this code snippet doesn't work??

Rick Flower rickf at pnet02.cts.com
Sat Oct 15 15:00:17 AEST 1988


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);
}

------------------------------------------------------------------------------

        I would think that it would just insert the 10 and 20 and 30 and 40 in
the appropriate places in the fmt line.. but it only does the 1st two
numbers..  the other two are garbage values..

Thanks in advance..

===============================================================================
                                I Thought So...

UUCP: {ames!elroy, <backbone>}!gryphon!pnet02!rickf
INET: rickf at pnet02.cts.com
===============================================================================



More information about the Comp.lang.c mailing list