Is strncpy() a specialization of memcpy()?

后端 未结 5 1563
伪装坚强ぢ
伪装坚强ぢ 2021-01-25 01:59

Just curious to know (as we use these functions often). I don\'t see any practical difference between strncpy() and memcpy(). Isn\'t it worth to say that effectively,

         


        
5条回答
  •  失恋的感觉
    2021-01-25 02:27

    No, strncpy() is not a specialization, since it will detect a '\0' character during the copy and stop, something memcpy() will not do.

提交回复
热议问题