TIP: Click on subject to list as thread! ANSI
echo: c_echo
to: Bill Birrell
from: Jonathan de Boyne Pollard
date: 2003-03-11 13:57:10
subject: portability

ÚÄÄÄÄÄÄÄÄÄÄÄÄÄÄ¿
 BB>>>         *p++ = (char)((i >= 10) ?³i + ('A' - 10)³: i + '0');
                                        ÀÄÄÄÄÄÄÂÄÄÄÄÄÄÄÙ
                                               ³
 JdeBP> This is the point that all of the peopl³ experienced
 JdeBP> with EBCDIC curse you for writing non-p³rtable code.
                                               ³
 BB> The line simply converts digits greater th³n 9 to hexadecimal
 BB> notation, whatever character representatio³ is in use, so I would
 BB> consider it a favour if you would tell me ³xactly what it is that is
 BB> not portable.                             ³
                                               ³
ÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÙ

The routine is incapable of producing a string in base 36 when the
execution character set is EBCDIC.

Bear in mind that not all uses of itoa() are for producing strings that are
intended for display to human beings.  Some people use base 36 for
generating filenames, for example.

( Of course, this sort of use is an example of why sprintf() is not a
complete replacement for itoa(). )

 ¯ JdeBP ®

--- FleetStreet 1.22 NR
* Origin: JdeBP's point, using Squish (2:257/609.3)
SEEN-BY: 633/267 270
@PATH: 257/609 255/90 140/1 106/2000 633/267

SOURCE: echomail via fidonet.ozzmosis.com

Email questions or comments to sysop@ipingthereforeiam.com
All parts of this website painstakingly hand-crafted in the U.S.A.!
IPTIA BBS/MUD/Terminal/Game Server List, © 2025 IPTIA Consulting™.