Subj : Re: malloc() To : borland.public.cpp.borlandcpp From : waking Date : Thu Jun 24 2004 07:56 pm On Wed, 23 Jun 2004 13:03:35 -0300, "Sebastian Ledesma" wrote: >Can you try something like this? I hope not. ;-) > char *p=realloc ( strlen( szInput ) + 1 ); Look at the prototype for realloc. It needs two arguments. e.g. - char *p=realloc (txtBuf, strlen( szInput ) + 1 ); > n=sizeof(txtBuf )-1; //assuming 1 char wide :-) Nope. The expression sizeof(txtBuf) will give the size of the txtBuf pointer variable itself, not the size of the allocation to which it points. You can't get the allocated size using the sizeof operator. (Which is usually evaluated at compile time not at run time.) -- Wayne A. King (waking@idirect.com, Wayne_A_King@compuserve.com) .