what's the meaning of *&

后端 未结 2 1613
鱼传尺愫
鱼传尺愫 2021-01-27 11:39

I am a java coder and not familar with the c++ language. But right now,i read the following code:

void method(A* a,A*& b);

A *a;
A *b;
method(a,b);
<         


        
2条回答
  •  小鲜肉
    小鲜肉 (楼主)
    2021-01-27 12:02

    b is a reference to a pointer of A.

    So if method sets b, the b in scope of the call will be changed.

提交回复
热议问题