--- In [email protected], Kayo Hisatomi <[EMAIL PROTECTED]> wrote:
>
> Hi Roberto,
> 
> The problem is in this line in the main() function:
> 
>    char *s0 = "   bye 1   ";
> 
> You are not allocating memory for the string, but just for
> the pointer. So, try this:
> 
>    char s0[] = "   bye 1   ";
> 
> And the program will work.
> 
> Regards,
> Kayo.
> 

Yes, this was the problem!
I was confused with the two rows above.
To assign a string to an array is right, but doing the same to a 
pointer need a strcpy or sprintf with the pointer of an allocated 
memory area, as you said.

Thanks a lot, I spent a week to search the problem in the function, 
but the problem was out of it.

Now it works.

Reply via email to