[Top][All Lists]
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
itoa implementation
From: |
Peter Enseleit |
Subject: |
itoa implementation |
Date: |
Wed, 04 Jul 2001 02:37:30 |
I am a newbie here so excuse my ignorance please on some libstdc++ matters.
I have come from an MS Visual Studio C++ background and am trying to write
some simple software in Linux using c++ (libstdc++ ver 3).
I have found that there is no itoa function to convert an integer to ascii
in libstdc++ yet.
Maybe something to put on the drawing board as it is a very useful little
function.
In the meantime can anyone suggest another way of doing the same thing - ie:
converting a simple integer to ascii for writing to file.
I have tried casting with (char*), reinterpret_cast<char*>() etc and these
compile fine but, they all give me runtime segmentation faults errors.
My quick fix is to writ a crude Myitoa function using a switch statement. (I
only need to convert numbers from 1 to 50), but I would prefer something
better.
I am a fairly inexperienced coder, so please excuse my ignorance if I have
missed something obvious.
Peter Enseleit
_________________________________________________________________________
Get Your Private, Free E-mail from MSN Hotmail at http://www.hotmail.com.
- itoa implementation,
Peter Enseleit <=