A C++ compiler that I will not name lets you take the address of a literal, int *p = &42;
Clearly 42 is an r-value and most compilers refuse to do so.
W
It effectively requires the compiler to initialize a pointer with the address of an integer with the value 42
Then why, in some compilers, we can't take the address of a literal directly ?
int* ptr = &10;
The reference:
int& ref = 10;
is almost the same thing as a pointer, though...