On Wed, Jun 11, 2008 at 8:52 PM, Vardhan, Sundara (GE Infra, Energy) <sundara.vardhan@xxxxxx> wrote: > When I printed temp, it looked file, but when I printed a it was garbled. I had initialized as a[0]='\0'; > > The same program works fine in Sun and IBM. Is there anything in GCC that I need to use as flag to have this not occur? > Any help or pointers will be greatly appreciated. Both variables printed fine in my test. Please post a full test including your initialization of a. Assigning the pointer to a local variable and reurning that value is fine. corey