how to copy integer into string

Oct 12, 2009 at 3:53pm
i need to copy int idno[50]
into char idno2[50][13] so i can use it for my graphics.h command outtextxy(x1,x2,y1,y2,idno[1]) because it only takes on character data types and i dont know a command which i can use to print out an integer into a specific coordinate. PLEASE i need to pass it tommorow :( thanks!

ps, im using borland c++ compiler because were required to use it. :)
Last edited on Oct 12, 2009 at 3:54pm
Oct 12, 2009 at 4:09pm
You can use sprintf for the corresponding elements of the two arrays: sprintf ( idno2[n], "%d", idno[n] );
Oct 12, 2009 at 4:32pm
it worked! haha! thanks :D ure a life saver :))
Topic archived. No new replies allowed.