hello friend....
if i wanto to acces local variable in other function in same class, how can i?? example : i have function A, B in same class. i want to acces values variable in class A from function B. i tried using pointer, but it did not work. this my code:
or any suggestion ??Code:#include <iostream> using namespace std; int* akses_a1; void A() { int a1 = 2; int a2 =3; akses_a1 = &a1; } void B() { cout << *akses_a1 <<endl; } int main() { B(); return 0;




Reply With Quote