Subj : Re: strrev oddity To : borland.public.cpp.borlandcpp From : maeder@glue.ch (Thomas Maeder [TeamB]) Date : Tue Jan 06 2004 06:30 pm Georges writes: > strrev does something most odd! (5.02) > > reversing a string with brackets changes the bracket symbol so for > example > > strrev(" [12345] "); produces ]54321[ > Surely it should be [54321] !! You have already been told that your expectations are wrong here. Let me just add this note: strrev() is a non-Standard function, so I don't know how it's specified in Borland C++. But if it's close to http://makeashorterlink.com/?Y16221AF6 (aka http://developer.novell.com/ndk/doc/libc/index.html?page=/ndk/doc/libc/libc_enu/data/sdk1615.html , which might wrap), then the above call has undefined behavior. sttrev() as specified by Novell modifies the character array its argument refers to. OTOH, modifying a string literal such as " [12345] " has undefined behavior. .