Article View: comp.sys.powerpc
Article #3249Re: Debate: PowerMac "trounces" Pentium....???
From: Dan Pop
Date: Thu, 15 Feb 1996 17:50
Date: Thu, 15 Feb 1996 17:50
37 lines
2155 bytes
2155 bytes
In <4ftn81$5sv@meaddata.lexis-nexis.com> christw@meaddata.com (Christopher C. Wood) writes: >In article <stephenkDMqrH6.Bo5@netcom.com>, stephenk@netcom.com (Stephen Knilans) writes: > >|> >What is the non-trivial method to convert an integer into an ASCII >|> >representation of its value? All I need is code that will run on >|> >Solaris (2.3) and HPUX 9. > >|> You ask for it, you got it! > >This code prints a string to stdout. I wanted to convert the integer >to a string to pass on to a different function. One would think the >"standard" atoi() would work. Only a fool could think something like this. atoi (which is a standard C function, no double quotes required) converts a string to an int, as its name says: Ascii-TO-Int. Got it? >But if you're running two very popular (possibly the two most popular) >unix implementations, you have to do this differently; lltostr() on >Solaris 2.3 (by the way, the man page for this function, as >distributed by Sun, is wrong.), and ltoa() on HP. > >Unix has so many standards, you almost always pick the wrong one. This is precisely why clever programmers choose the ANSI C solution whenever possible (sprintf in this case). BTW, neither lltostr nor ltoa are part of any Unix standard that I know of. If you use vendor-specific extensions, you get what you deserve. Dan -- Dan Pop CERN, CN Division Email: danpop@mail.cern.ch Mail: CERN - PPE, Bat. 31 R-004, CH-1211 Geneve 23, Switzerland
Technical Details
Message-ID:
<danpop.824406631@rscernix>Path:
arc1-ca.pugleaf.net!rcp6.elan.af.mil!rscernix!danpopReferences:
<nevin-1202960529130001@150.135.1.79> <9602121654.AA02634@ues5.cern.ch> <4fqdta$rhh@meaddata.lexis-nexis.com> <stephenkDMqrH6.Bo5@netcom.com> <4ftn81$5sv@meaddata.lexis-nexis.com>Show Full Headers
Complete Article Headers
Path: arc1-ca.pugleaf.net!rcp6.elan.af.mil!rscernix!danpop From: danpop@mail.cern.ch (Dan Pop) Newsgroups: comp.sys.powerpc,comp.os.linux.advocacy,comp.sys.mac.advocacy,comp.os.os2.advocacy,comp.sys.amiga.advocacy,comp.sys.intel Subject: Re: Debate: PowerMac "trounces" Pentium....??? Date: 15 Feb 96 17:50:31 GMT Organization: CERN European Lab for Particle Physics Message-ID: <danpop.824406631@rscernix> References: <nevin-1202960529130001@150.135.1.79> <9602121654.AA02634@ues5.cern.ch> <4fqdta$rhh@meaddata.lexis-nexis.com> <stephenkDMqrH6.Bo5@netcom.com> <4ftn81$5sv@meaddata.lexis-nexis.com> NNTP-Posting-Host: ues5.cern.ch X-Newsreader: NN version 6.5.0 #7 (NOV)