Until now, we have used arrays of char to work with strings. Using pointers, strings can be created and used in a more efficient way.
Syntax
char *name = "string_content";
Note
\0 is automatically appended to
strings in both casesCode example
char *str = "Cortex";

At initialization, a pointer to a string points to the first character. To access subsequent characters, add an offset to the pointer.

An entire string may be assigned to a pointer in a single step, while a character array must be assigned character
by character. Also, you must explicitly add the NULL character \0 to an array.
Code example
// Pointer variable
char *str;
str = "Cortex";
// Array variable
char str[7];
str[0] = 'C';
str[1] = 'o';
str[2] = 'r';
str[3] = 't';
str[4] = 'e';
str[5] = 'x';
str[6] = '\0';