forums.ps2dev.org Forum Index forums.ps2dev.org
Homebrew PS2, PSP & PS3 Development Discussions
 
 FAQFAQ   SearchSearch   MemberlistMemberlist   UsergroupsUsergroups   RegisterRegister 
 ProfileProfile   Log in to check your private messagesLog in to check your private messages   Log inLog in 

itoa missing?

 
Post new topic   Reply to topic    forums.ps2dev.org Forum Index -> PSP Development
View previous topic :: View next topic  
Author Message
HexDump



Joined: 07 Jun 2005
Posts: 70

PostPosted: Tue Mar 28, 2006 8:21 pm    Post subject: itoa missing? Reply with quote

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.
Back to top
View user's profile Send private message
chp



Joined: 23 Jun 2004
Posts: 313

PostPosted: Wed Mar 29, 2006 4:00 am    Post subject: Reply with quote

sprintf() should do the trick, don't you think?
_________________
GE Dominator
Back to top
View user's profile Send private message
HexDump



Joined: 07 Jun 2005
Posts: 70

PostPosted: Wed Mar 29, 2006 4:04 am    Post subject: Reply with quote

sure, it will. I was ofuscated :).


Thanks.
HexDUmp.
Back to top
View user's profile Send private message
PeterLeRoi



Joined: 16 May 2007
Posts: 31

PostPosted: Sun Jun 03, 2007 11:44 pm    Post subject: Reply with quote

I can´t do the trick :(

I need to do:

Code:
int size = XXXXX; (any value)
sceIoWrite(fp,itoa(size),4);

and it should be written in LBS Hex.

I´m trying with:

Code:
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 ;)
Back to top
View user's profile Send private message
rapso



Joined: 28 Mar 2005
Posts: 147

PostPosted: Mon Jun 04, 2007 1:00 am    Post subject: Reply with quote

try
Code:
%x
Back to top
View user's profile Send private message
PeterLeRoi



Joined: 16 May 2007
Posts: 31

PostPosted: Mon Jun 04, 2007 6:35 am    Post subject: Reply with quote

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

Thanks ;)
Back to top
View user's profile Send private message
Display posts from previous:   
Post new topic   Reply to topic    forums.ps2dev.org Forum Index -> PSP Development All times are GMT + 10 Hours
Page 1 of 1

 
Jump to:  
You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot vote in polls in this forum


Powered by phpBB © 2001, 2005 phpBB Group