0

can i access any memory in my program like i did in my program it gives error?

#include<iostream> using namespace std; int main() { int a=*(0x69fef8);/*this address which i have assign to it and i have take this address from another program's variable's address*/ int *p=&a; cout<<*p; }

3rd Jun 2018, 4:00 AM
Bahubali
Bahubali - avatar
8 odpowiedzi
+ 1
Uttrakhand mein college ,rehta mp mein
3rd Jun 2018, 4:54 AM
Bahubali
Bahubali - avatar
+ 1
isse ho jayega par agar address me integer nai h ya address change hoga to segmentation fault aayega #include<iostream> #include <cstdint> using namespace std; int main() { uintptr_t p = 0x69fef; int value = *reinterpret_cast<int *>(p); cout<<value; }
3rd Jun 2018, 5:22 AM
‎ ‏‏‎Anonymous Guy
+ 1
thanks ab ye bhi padna padega
3rd Jun 2018, 6:33 AM
Bahubali
Bahubali - avatar
0
is this a user-defined function or did you misspell main in 3rd line
3rd Jun 2018, 4:13 AM
‎ ‏‏‎Anonymous Guy
0
aa Gaya bhai tu hi hai jo logo ki madad karta hai.kahan rahte ho aur college aur school main hai sorry
3rd Jun 2018, 4:16 AM
Bahubali
Bahubali - avatar
0
are college ka abi chtti chalu h to pura time ispe aur madad krke kuch sikhne mil jata h
3rd Jun 2018, 4:36 AM
‎ ‏‏‎Anonymous Guy
0
sahi hai mein bhi college mechanical main huun tu cs?Kahan rahete ho?
3rd Jun 2018, 4:44 AM
Bahubali
Bahubali - avatar
0
maharashtra aur tum kudr se ho
3rd Jun 2018, 4:52 AM
‎ ‏‏‎Anonymous Guy