Re: [AD] Reverse String function... |
[ Thread Index |
Date Index
| More lists.liballeg.org/allegro-developers Archives
]
On Tue, Apr 16, 2002 at 05:59:59PM +0200, Carmelo Maiolino wrote:
> Hi guys,working on a program , i needed a reverse string function...i
> watched out to allegro string API, but i didn't find anything, so i had to
> develop it by byself.
> Why don't add a function like this to Allegro?
> It reverses nchar characters from the start of the string s returning the
> pointer to reversed string
> What do you think?
Well, like Vincent said, it returns a pointer to the stack, which is going
to break horribly. Did you test it at all?
Also, the code isn't unicode save. I suggest you have a look at the Allegro
Unicode routines and/or Allegro source code to figure out how to do this
correctly (this is pretty tricky; took me a while and I'm not 100% certain
my code is save either).
Evert Glebbeek