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

后端 未结 10 1116
眼角桃花
眼角桃花 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 C-style string is internally represented by array of character with the '\0' at end, which indiciates the end of string.

    In C++, there's a string container class defined in string.h which provides some typical string operations to manipulate the string.

提交回复
热议问题