Re: problems with char * return from a function

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



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

[Index of Archives]     [Linux C Programming]     [Linux Kernel]     [eCos]     [Fedora Development]     [Fedora Announce]     [Autoconf]     [The DWARVES Debugging Tools]     [Yosemite Campsites]     [Yosemite News]     [Linux GCC]

  Powered by Linux