字符串是最常用的一种数据类型了,在python中声明字符串和声明其他类型的数据一样,都非常的简单。但是在c++中,对于字符串的操作,相对来说要稍微复杂一些。
C++ 提供了以下两种类型的字符串表示形式:
C 风格字符串
C++ 引入的 string 类类型
C 风格的字符串起源于 C 语言,并在 C++ 中继续得到支持。字符串实际上是使用 null 字符