Difference between memcpy and strncpy

Oct 10, 2013 at 7:17am
pls tell the difference between memcpy and strncpy.

Oct 10, 2013 at 7:34am
Note that strncpy behaves almost like memcpy, but it also treats zero character (end of ASCII-Z string) specially, padding destination with zeroes after that point.

I.e. strncpy works like memcpy for data not containing zero byte.

http://www.cplusplus.com/reference/cstring/strncpy/
Topic archived. No new replies allowed.