In: Computer Science
In C++, cstring is implemented as an array of characters. What is the difference between cstring and a regular array of characters? In other words, how do you distinguish them?
A character array is a data structure in the C++ programming language: a number of bytes in memory in which you may store characters. You can store any character (i.e., bytes of 8-bits, value 0 to 255) in each of these cells.
A C-style string (as what I interpret “c-string” in your question to mean) is a way to represent a “string” of characters, defined by the C language to be a number of characters without the null byte (value 0). This is represented by those characters themselves followed by a null byte, thus that there is no need to separately store the length of the string. Contrast this with the Pascal-style string, where it is represented by a 16-bit unsigned integer followed by that number of bytes of information (so that the length of the Pascal string is at most 65535).
So a character array is a data structure, C-style string is data representation. They are different beasts.
A character array can hold a C-style string, or it may hold something else (e.g., it contains useful information after the null character, or contains no null character whatsoever); and even so you might be able to interpret it as a C-style string anyway (as long as it contains at least one null character). A C-style string may be stored in a character array, or it may be stored in somewhere not an array (e.g., a read-only part of the memory and thus cannot “store” other values).