The problem is the use of the word "string". C provides a set of functions for dealing with three distinct "string-like" data structures. The first is for 0-terminated sequences, sometimes called "C strings" -- these are the functions like strlen, strcpy. The second is zero-padded, fixed-width fields: functions for operating on this structure include strncpy, strncmp, calloc, fread, fwrite. The third are byte sequences with a separate length, functions for this kind of data structure include memcpy and memcmp.