Hi
I am trying to get an allegro game/tutorial working on linux and found out itoa is not a good way to convert integer to ascii but I am having trouble implementing the substitution I found by searching the internet.
sprintf(buf, "%d", intval);
The lines in the code giving me the problem are
textout(buffer,pong_datafile[pong_text].dat,"Player 1 Score:",150,0,254);
textout(buffer,pong_datafile[pong_text].dat,itoa(score_p1,NULL,10),text_length(pong_dataf ile[pong_text].dat,"Player 1 Score:")+150,0,10);
textout(buffer,pong_datafile[pong_text].dat,"Player 2 Score:",350,0,254);
textout(buffer,pong_datafile[pong_text].dat,itoa(score_p2,NULL,10),text_length(pong_dataf ile[pong_text].dat,"Player 2 Score:")+350,0,10);
itoa is used (I suppose) to convert a number extracted from the pong.dat file to text. I can delete the two lines containing the itoa and it compiles fine of course.
How should sprintf be implemented in this context?
Thanks