Do pointers also point to C style strings?

111 Views Asked by At

From my knowledge of pointers if, am right, pointers are holder of memory address, so how does pass by const char pointer which took in an RVALUE even work.

Here's the code.

#include <iostream>

void Log(const char* message)
{
    std::cout << message << std::endl;
}

int main()
{
    Log("hello");
}

From what remember from pass by address in my pointers lessons, the argument entered will be stored in the const char* message argument as a memory address to whatever variable but here's the case where "hello" is a rvalue with no identity so how does this work.

0

There are 0 best solutions below