What is the difference between a Character Array and a String?

后端 未结 10 1085
眼角桃花
眼角桃花 2020-12-10 11:49

Spending my time on high level languages it suddenly occurred to me that I did not know the difference between a Character Array and a String. I think they are the same thin

10条回答
  •  醉梦人生
    2020-12-10 12:26

    a character array is simply an array of characters

    a string is data structure that uses an array of characters

    some string representations use a null-terminator (like C), others use a length prefix

提交回复
热议问题