hi,tkank you guys come in and I got a question in C++.
Like thread's title suggest, can I operate a variable of another application in my program by a pointer?
code might be :
int *pi ,address=0,buf=0;
std:cout<<"enter the address of a variable:";
std:cin>>address;
*pi = (int*) address;
std:cout<<"change variable at "<<address<<"into:";
cin>>buf;
*pi = buf;
I had complied that code,but when change the data, the application crashed.
So,I can't do this?Or there's something wrong of my approach?
If this way don't work, there's any other ways to do that?To change other applications variable in my program,I mean.
Like thread's title suggest, can I operate a variable of another application in my program by a pointer?
code might be :
int *pi ,address=0,buf=0;
std:cout<<"enter the address of a variable:";
std:cin>>address;
*pi = (int*) address;
std:cout<<"change variable at "<<address<<"into:";
cin>>buf;
*pi = buf;
I had complied that code,but when change the data, the application crashed.
So,I can't do this?Or there's something wrong of my approach?
If this way don't work, there's any other ways to do that?To change other applications variable in my program,I mean.