itoa missing?

Discuss the development of new homebrew software, tools and libraries.

Moderators: cheriff, TyRaNiD

Post Reply
HexDump
Posts: 70
Joined: Tue Jun 07, 2005 9:18 pm

itoa missing?

Post by HexDump »

Hi everyone,

I know itoa is not ansi C, but I´m wondering if it is any version of this funcion in the psp sdk. I could write mine, but I´m just curious.

Edit: I have noticed a _itoa exists in the libc/stdlib.h folder but if I include this, I get symbol collisions with the stdlib.h that it includes by default :/.


Thanks in advance,
HexDump.
chp
Posts: 313
Joined: Wed Jun 23, 2004 7:16 am

Post by chp »

sprintf() should do the trick, don't you think?
GE Dominator
HexDump
Posts: 70
Joined: Tue Jun 07, 2005 9:18 pm

Post by HexDump »

sure, it will. I was ofuscated :).


Thanks.
HexDUmp.
PeterLeRoi
Posts: 31
Joined: Wed May 16, 2007 11:08 am

Post by PeterLeRoi »

I can´t do the trick :(

I need to do:

Code: Select all

int size = XXXXX; (any value)
sceIoWrite(fp,itoa(size),4); 
and it should be written in LBS Hex.

I´m trying with:

Code: Select all

char bufferaux[5];
sprintf(bufferaux,"%d",size);
sceIoWrite(fp,bufferaux,4)
but doesn´t work.


One example: if I had int size = 16;
I need to write "0x10 0x00 0x00 0x00"

Can anybody help me? I´m new at programming psp.

Thanks ;)
rapso
Posts: 140
Joined: Mon Mar 28, 2005 6:35 am

Post by rapso »

try

Code: Select all

%x
PeterLeRoi
Posts: 31
Joined: Wed May 16, 2007 11:08 am

Post by PeterLeRoi »

What is "%x" for? hex integer? Do I need to worry about the Less Significant Bit?

Thanks ;)
Post Reply