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

后端 未结 10 1150
眼角桃花
眼角桃花 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:44

    It depends on the language. In C-ish languages, they are pretty much synonomous. You could claim the difference is that "strings" have an implicit terminating nul, but that would be splitting hairs.

    Fortran is the other extreme. There character arrays and character strings are entirely different types, with different operations available for them.

提交回复
热议问题