Q: I see strings often assigned to pointers during initialization.
I think, what you are calling as string is actually a string literal.
According to C11
standard, chapter §6.4.5
A character string literal is a sequence of zero or more multibyte characters enclosed in
double-quotes, as in "xyz"
. [...]
The representation, "xyz"
produces the address of the first element of the string literal which is then stored into the pointer, as you've seen in the initialization time.
Q: Does the pointer automatically assign an address to store the string and point itself to that address?
A: No, the memory for storing the string literal is allocated at compile time by the compiler. Whether a string literal is stored in a read only memory or read-write memory is compiler dependent. Standard only mentions that any attempt to modify a string literal results in undefined behavior.
Q: How does "dereferencing" works in pointers to strings?
A: Just the same way as it happens in case of another pointer to any other variable.