Path: utzoo!utgpu!news-server.csri.toronto.edu!rutgers!usc!zaphod.mps.ohio-state.edu!wuarchive!swbatl!texbell!uudell!bigtex!texsun!letni!void!ozdaltx!toma From: toma@ozdaltx.UUCP (Tom Armistead) Newsgroups: comp.lang.c Subject: Re: integer to string function (itoa()) Summary: Sprintf will do it Message-ID: <6556@ozdaltx.UUCP> Date: 3 Jul 90 03:16:57 GMT References: <22888@boulder.Colorado.EDU> Distribution: usa Organization: AIDS INFO EXCG/OZ BBS - Dallas, TX Lines: 25 In article <22888@boulder.Colorado.EDU>, baileyc@boulder.Colorado.EDU (BAILEY CHRISTOPHER R) writes: > > Help, I need an itoa() function for use with my Sun compiler. It seems > as if only PC versions of C have itoa functions. So, source code for > an integer to string function would be very helpful. Thanks! I can't wait to here the flames about this one... If you are in a hurry or not real concerned about performance, you can use sprinf() to replace the itoa() function. i.e. char buf[10]; int number=100; sprintf( buf, "%d", number ); Now buf will contain the ASCII representation of number. Tom -- ------------------------------- {uunet,smu}!sulaco!ozdaltx!toma (Tom Armistead @ Garland, Texas) {uunet,smu}!sulaco!ozdaltx!swsrv1!toma