On Mon, 8 Sep 2008 13:59:05 -0500, Wayne Driscoll wrote:
>However, as mentioned if you are expecting the value to later be used as
>null-terminated string, you need to add
>Dest[8] = 0x00;
ITYM
Dest[7] = 0x00;
>Or the value of the byte after the ending 'L' is un-predictable.
>
Actually, no. either of the OP's forms will supply the 0x00.
>If I am copying literal text into a char array, which do you think is
>better:
>
>strcpy(dest,"LITERAL");
>
>OR
>
>memcpy(dest,"LITERAL",8);
And both are quite safe, provided that "dest" has been
defined as at least 8 characters.
-- gil
----------------------------------------------------------------------
For IBM-MAIN subscribe / signoff / archive access instructions,
send email to [EMAIL PROTECTED] with the message: GET IBM-MAIN INFO
Search the archives at http://bama.ua.edu/archives/ibm-main.html