Path: chuka.playstation.co.uk!news From: "Rikki Prince" Newsgroups: scee.yaroze.beginners Subject: Re: integer to string Date: Sat, 26 Jun 1999 22:17:22 +0100 Organization: PlayStation Net Yaroze (SCEE) Lines: 44 Message-ID: <7l3g2e$1113@chuka.playstation.co.uk> References: <7l2qan$qpv24@chuka.playstation.co.uk> <7l3795$qpv25@chuka.playstation.co.uk> <7l3e9g$1111@chuka.playstation.co.uk> NNTP-Posting-Host: th-gt145-107.pool.dircon.co.uk X-Priority: 3 X-MSMail-Priority: Normal X-Newsreader: Microsoft Outlook Express 5.00.2014.211 X-MimeOLE: Produced By Microsoft MimeOLE V5.00.2014.211 Well, then you should be able to just pass a string such as "Hello 123", and your routine should display it, however, your function will need to support it. How are you displaying to screen? If you're using a big sprite with your font, then changing your .u and .v values to display the correct character, then this is where you have to fix it, by adding your font's version of the numbers 0-9, and then add support in your programs function which gives you the u and v values for all your characters... Actually, now that I reread your message, I may have got the wrong end of the stick, but I've left the above in, just in case. If you wanted to know how you could take an integer variable, and pass it to your function, to display it, like printf and FntPrint take %d, and the name of the variable at the end of the parameters, then you could handle variable parameters, but this is a bit tricky, but I could dig out some info if this is what you want, or you could just take your string pointer, and add the beginning text to it, then typecast your integer variable to char, and add it to your string pointer, and so on. If you need this explained in more detail, post again, coz this reply's a bit crap, and 'all-over-the-place' Thanks Rikki Matt Verran wrote in message news:7l3e9g$1111@chuka.playstation.co.uk... > Basically I have a function that renders text (passed as 'char *text') to > the screen. I need to be able to pass integer values to the function, like > '13' or '2056' etc... > > > Rikki Prince wrote in message <7l3795$qpv25@chuka.playstation.co.uk>... > >Do you have an array of ints? If so, then loop through the array of ints, > >and the equivalent char array element. The assignment would probably look > >like: > >char[counter] = ((char *)int[counter])+48; > >I'm not sure about the (char *) bit, but it will be either that or (char), > >but this could be sussed out with some simple testing. Why don't you post > >whatever code you've got to see where you're having problems? > > > > >