What is special about the array of char?
Answers
Answered by
14
A character array is a collection of the variables of “char” datatype; it can be a one-dimensional array or a two-dimensional array. It is also called “null terminated string”. A Character array is a sequence of the characters that are stored in consecutive memory addresses.
Answered by
8
Special about the array of char:
- Char array or array of char is used to print or display the sequence of characters or numbers. With the help of a character array, we can store the variable in a memory to a correspondence memory address.
- For example, char a [10] is an example of a character array storing 10 numbers in a variable. Another example: char a [3] = {a, b, c, d}. For example, a will be stored in x [0], b will be stored in x [1], c will be stored in x [2] and d will be stored in x [3].
Similar questions