Strings

Sequence of characters enclosed in double quotes
A one-dimensional character array can be used to store a string (as long as it ends with a null character
\0)

Declaration
Vector declaration of a char vector with length
length
Dynamic allocation dynamic allocation of a memory area of
lengthbytes, which is organized as acharsequence (1 Byte each)
Inizialization
With implicit size
where the length of the string is:
With explicit size
if
length >= (num_string_characters + 1), the string occupies the"value"number of characters + 1 (/0)else KILLED PROCESS
Vector of strings
With an array
With a pointer
Initialization
With an array
where:
array_size: number of strings in the vector (# of elements)string_size: maximum number of characters for the strings
One or both the parameters can be omitted and are retrieved automatically.
With a pointer
It implicitly calculates both the number of strings and the number of characters in each individual string (by evaluating the values on the left)

Last updated