所以我有一个具有以下类型的受保护的指针成员在递归函数中覆盖函数参数?
int *assigntoThis; // In the constructor I have initialized this to NULL.
我也有相同类的公共递归成员函数声明如下
bool find(int* parent, std::string nameofnode, int* storeParentinThis);
递归函数的类通过子节点进行检查,如果子节点的名称与作为参数传入的字符串相匹配,则会将父节点的地址分配给storeParentinThis。
这就是我如何从同一类的另一个函数调用函数。
bool find(root, "Thread", assigntoThis);
然而,在运行时期间,当我输出存储在assigntoThis I的值获得00000000 = NULL。如何在递归函数中更改assigntoThis的值?
对于这里未来的参考是线程后面这个问题的理由http://stackoverflow.com/questions/1898524/difference-between-pointer-to-a-reference-and-reference-to-a指针 – user1084113 2012-07-11 19:01:59