I'm a bit stumped that passing an array of char values to a const char* prints the entire string literal.
void log(const char* message)
{
std::cout << message << '\n';
}
When I dereference 'message' in cout, it prints the first element of the char array passed, which is what I expected; however, the fact that 'message' is a pointer to the whole string literal rather than the first element is confusing me. Why aren't I just getting an address to the first element like I would if I used an int instead of char? Is it something to do with a char being just 1 byte?