重複の可能性:
参照へのポインターとポインターへの参照の違い
私は C++ の初心者で、かなり複雑なプロジェクトに取り組んでいます。何かを理解しようとしたとき、1 つの興味深いことがわかりました。
n->insertmeSort((Node *&)first);
insertmeSort を深く掘り下げると、同じことがわかります。
void Node::insertme(Node *&to)
{
if(!to) {
to=this;
return;
}
insertme(value>to->value ? to->right : to->left);
}
だから私の質問の理由は次のとおりです: Node *&
- アスタリスクとアンパサンド、何のために?
それはかなりトリッキーで、私には興味深いようです。