xeus-cling
xeus-cling copied to clipboard
Why printing an address `&x` do not work?
I tried to inspect the address of an variable x
with:
int x = 42;
&x
It showed:
@0x7ffc383a5a88
But if I use printf
to print the address, the result is different:
printf("&x=%p\n", &x)
It showed:
&x=0x7f69a0a6c0e0
If you create another int y
and print its address with &y
, it' the same with &x
!
int y = 99;
&y
It showed:
@0x7ffc383a5a88
Seems like printing an address with &x
is not working. Why?
Thanks for reporting. I think we are missing an overload of mime renderer for pointers, and thus it print the address of an internal object.