So I'm writing my own printf function so I'm using stdarg.h and the system call write(). But I have no idea on how to incorrect %p into my function. Would %X produce the same result?
I have %x done as so:
'x': x=va_arg(argp,argp, unsigned int);
char *temp = convert(x,16);
write(1, temp, lengthOFtemp);
break;
char *convert(unsigned int, int)
{
static char buf[33];
char *ptr;
ptr=&buf[sizeof(buff)-1];
*ptr='\0';
do
{
*--ptr="0123456789abcdef"[num%base];
num/=base;
}while(num!=0);
return(ptr);
}