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

前端 未结 7 636
伪装坚强ぢ
伪装坚强ぢ 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 18:09

    It refers to how C strings are stored in memory. The NUL character represented by \0 in string iterals is present at the end of a C string in memory. There is no other meta data associated with a C string like length for example. Note the different spelling between NUL character and NULL pointer.

提交回复
热议问题