I am new to C++, I have a function which returns address of a memory location and I want to assign that address to a pointer, just like:
unsigned int address = 0xdeadbeef; unsigned int* memory_ptr = (unsigned int*) address;
But above code is through warning:
cast to pointer from integer of difference size [-Wint-to-pointer-cast]
Is there anyway to do this task cleanly in C++ ?
User contributions licensed under CC BY-SA 3.0