Search code examples
paradigms

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


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 thing but not sure. Is there a difference? Is it just a Character Array with some abstraction?


Solution

  • 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