<snip>

If I am copying literal text into a char array, which do you think is 
better:

strcpy(dest,"LITERAL");

OR

memcpy(dest,"LITERAL",8);

</snip>

FWIW,

IIRC, strcpy will copy until a x'00 is encountered. This results in a
"variable length" copy. If no x'00' is encountered, strcpy will happily
copy all of storage until it tries to access un-owned storage, at which
time there will be a S0C4 (U4039 in LE terms) abend.

Memcpy will copy storage for the length indicated.

I concur with the other poster (and yourself) that memcpy is the
preferred method.

HTH,

----------------------------------------------------------------------
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

Reply via email to