Beginner question: How can I take the adress of a pointer and save it as an int? Example:
int *ptr = xyz;
int i = static_cast<int>(ptr);
So if ptr points to the memory adress 123, i should be 123. My compiler says it's an error: invalid static_cast from type 'int*' to type 'int'
.
Guess I am missing something but I don't know what.