[Solved] I lose pointer or an address? It acts like never happen [closed]

[ad_1]

Your a is a temporary object in fun(). I fyou want fun() to change the pointer to a you’ll need to take the pointer as reference:

int fun(int*& a) {
    a = fun2();
}

Note that this interface is probably severely broken.

[ad_2]

solved I lose pointer or an address? It acts like never happen [closed]