Subj : Re: Local character strings To : borland.public.cpp.borlandcpp From : John F\(dot\) Date : Mon Sep 26 2005 09:09 pm "Thomas Maeder [TeamB]" wrote: > As I tried to make clear in my last post, you shouldn't do this in new > code. The line only compiles because of a deprecated feature. > > Do this instead: > > char const * MyTextPointer = "2 Pointer"; >> if (version == 1) >> MyTextArray[0] = MyTextPointer[0] = '1'; > > ... and the compiler will help you avoiding this kind of undefined > behavior. General rule: Use const as much as possible! especially on pointers... J .