We usually declare such variables in C ++:
int exampleInteger;
What should I do if I have a pointer to the address of an integer? Can I declare an integer located at a specific memory address?
int* exampleIntegerPtr = (int*) 0x457FB; int exampleInteger = *exampleIntegerPtr;
Unfortunately, exampleInteger in the second example is not similar to the exampleInteger in the first example. The second example creates a new variable that has the same value as the integer located in exampleIntegerPtr. Is it possible to somehow capture the actual integer located in the IntegerPtr example?
source share