double address = 3068770752;
std::string hello = (char *)address;
error: invalid cast from type ‘double’ to type ‘char*’
So, if i use type long or int, this works, but with type double, this is not working.
how can i do this?
Thanks!
EDIT: i’m programming a PHP extension in C++, this is a “content “of a custom function “get_memory_data(double address)”, in php you uses:
<?php
$a = "hello";
$b = get_memaddress($a); //0x123456
$c = hextodec($b); //3068770752
$d = get_memdata($c); //hello
Cast it to an integer first: