True, but that way (memset) I know that the buffer looks like.... it's 
been my experience that when working with 'strings' (lpsz_) in C it is 
best to be sure of the zero terminator. strcpy simply memov's the 
string in and adds a single 0 at the end of the character array, 
leaving the rest of the buffer in an unknown state. Me good geek, don't 
like unknown state!

For Sale: Nice Parachute, Used Once, Never Opened, Slightly Stained

Michael Comperchio
[email protected]

On Mar 5, 2009, at 5:51 PM, John Matthews wrote:

> --- In [email protected], Paul Herring <pauljherr...@...> wrote:
>  >
>  > On Thu, Mar 5, 2009 at 4:27 PM, Michael Comperchio <mcmp...@...> 
> wrote:
>  > > memset( buffer, 1000, 0);
>  > > strcat(buffer, first_text);
>  > > strcat(buffer, second_text);
>  >
>  > workable
>
>  although
>
>  strcpy(buffer, first_text);
>  strcat(buffer, second_text);
>
>  would be more efficient (no need to clear buffer first).
>
> 

Reply via email to