By the way, I used this to check if the said memory was edited:
Code:
#include <cstdlib>
#include <iostream>
using namespace std;
int main(int argc, char *argv[])
{
int *first_val;
int test;
test=10;
int *ptr;
ptr=&test;
cout<<"Press enter to loop memory adress"<<endl;
system("PAUSE");
cout<<"You are using the memory adress of "<<ptr<<" Wich has the value of "<<*ptr<<" Is this correct?"<<endl;
system("PAUSE");
first_val=ptr;
int i;
for(i=0;i<1;i+=i)
{
if(first_val!=ptr)
{
break;
cout<<"Memory was changed to "<<ptr<<endl;
}
}
}
and to change it I used:
Code:
#include <iostream>
#include <stdlib.h>
using namespace std;
int main()
{
int changed_val;
int address;
cout<<"Please type in a memory adress to change..."<<endl;
cin>>address;
*ptr =address;
cout<<"What would you like to change this value to?"<<endl;
cin>>changed_val;
cout<<"You are about to change the value of the adress "<<*ptr<<" To "<<changed_val<<endl;
system("PAUSE");
*ptr=changed_val;
return 0;
}