u16 Temp = 1230;
char strText[31] = "";
s16 Result = sprintf(strText, "Testing %i", Temp );
if (Result < 0) OutputText("Error");
if (Result == 0) OutputText("0 Caracter writed");
OutputText(strText);
Bug with sprintf()
Hi there, I'm trying to code for the GBA (game boy advance) to practice my seft to core coding :P
But I have a bug, sprintf dont work. It return that he write 0 caracter..
What I did in my main() :
My function OutputText(char*) work perfectly, because I can read :
"0 Caracter writed"
But I cant see "Testing" on the final OutputText because sprintf just dont work..
What can be the prob? Something to do with the gba? Because I see a guy using sprintf in his gba programme, and it work for him.
Thanks
hum... I declare this in the main :
u16 Map[512*512] = {0};
And if I comment it, sprintf work :S
Some ram trouble in the gba?
u16 Map[512*512] = {0};
And if I comment it, sprintf work :S
Some ram trouble in the gba?
Quote:Original post by DaivukLet's see, 512*512*2 = 512 kB. There's just no way that'll fit in 32 kB of IWRAM (or even in 256 kB of EWRAM, if you have a weird linker script).
hum... I declare this in the main :
u16 Map[512*512] = {0};
And if I comment it, sprintf work :S
Some ram trouble in the gba?
This topic is closed to new replies.
Advertisement
Popular Topics
Advertisement