scanf
needs the address of the variable to read into, and string buffers are already represented as addresses (pointer to a location in memory, or an array that decomposes into a pointer).
printf
does the same, treating %s
as a pointer-to-string.