Integer to Binary string

Bengt Richter bokr at oz.net
Sat Dec 7 12:19:20 EST 2002


On Fri, 06 Dec 2002 20:06:30 -0800, Erik Max Francis <max at alcyone.com> wrote:

>Bengt Richter wrote:
>
>> I assumed he wanted to use radix 2. The protoype is
>> 
>> char *_itoa( int value, char *string, int radix );
>
>Well, what prototype?  _itoa (nor itoa) isn't a standard function.  Most
>prototypes I've seen for it in private implementations don't include a
>radix argument (indeed, they don't even include an argument for
>specifying the buffer, but instead use a static one).
>
Well, ok, you're right ;-) The prototype above was from the MSVC++6.0 help docs,
and <prefix>\include\stdlib.h in that system contains the line

_CRTIMP char * __cdecl _itoa(int, char *, int);

but I see that grep -r itoa /usr/include/* comes up with nothing (in slackware Linux).

I guess "Integer to Binary string" in the subject was what made me look for something
different than "Binary Integer to string." Only the OP knows for sure ;-)

Regards,
Bengt Richter



More information about the Python-list mailing list