Re: [Dev-C++] itoa - simple implementation
Open Source C & C++ IDE for Windows
Brought to you by:
claplace
|
From: Luigi S. <gi...@li...> - 2003-04-03 07:21:14
|
On Wed, Apr 02, 2003 at 01:48:06PM +0300, Ioannis Vranos wrote: > This code is not good. Assume this: > > > char *p=itoa(9), *q=itoa(10); > > > I suggest to return a pointer on memory on the free store. > Hello, You are right, my simple implementation does not cope well with the above situation. I used the free store in my first implementation, then, following some advice, I attempted to use a static array, as that would probably be faster. Thanks for your suggestion -- >> gisan >> |