What does it mean to be “terminated by a zero”?

前端 未结 7 640
伪装坚强ぢ
伪装坚强ぢ 2020-12-06 17:21

I am getting into C/C++ and a lot of terms are popping up unfamiliar to me. One of them is a variable or pointer that is terminated by a zero. What does it mean for a space

7条回答
  •  谎友^
    谎友^ (楼主)
    2020-12-06 17:55

    C-style strings are terminated by a NUL character ('\0'). This provides a marker for functions that operate on strings (e.g. strlen, strcpy) to use to identify the end of the string.

提交回复
热议问题