So I have a quick question about pointers..
So far I have learned that the & sign tells the compiler where about's in the computers memory the value you wan't is stored.
and that you can use a pointer to access the value stored in that memory address.
But all the examples are like:
Code:
int fingers = 10;
int *Pointer = &finger;
cout << *pointer;
So as far as I understand, my program is accessing the memory address where int fingers is stored, and is pointing to the value that is stored within that memory address.
But what if I wan't the pointer to access a memory address that is not created within my program, if you understand what I am saying.
is it possible for me to put in a hexidecimal memory address before the & sign
like the following code?
Code:
int *Pointer = &0x93jfm
would that return the value that is stored in that memory address without declaring it or do I have to declare it or something, Sorry if I confused you,Iv'e only been learning c++ 1 day,and I wen't from finishing page 8 with switch statements and page 9 were pointers which is when my mind started racing with questions.
Thanks for your help
__________________________________________________ _________________
Okay, now I understand what I'm actually trying to say a little more.
Say the value you wanted to retrieve out of a memory address was not within your program, you wanted to retrieve the value of a diffrent memory address outside your program,
So far I have only learnt how to access the memory address of int's I have made, and then get the value of that.
but since I'm the one that made that int, and made it equal that value, It's not very usefull, atleast not for making hacks ect,it would be useful for transfering lots of data though ;P
so what If you didn't make the int,how would you point to it then?
Heres a little example to show you guys what I'm trying to do
Say I used olly dbg/cheat engine to find the memory address of what stores how many points you have in a card game of Solitaire,
so now I need to make a pointer to that memory address,How would I go about doing that? Can someone please also try explain the code, I'm trying to learn from this not just leech code examples,Thanks