public メンバー関数を持つ Node オブジェクトがあります。この場合、元のオブジェクトを指すポインター (またはダブル ポインター) がある場合、メンバー関数を呼び出すにはどうすればよいですか?
Node クラスのメンバー関数は次のとおりです。
class Node {
public:
...
int setMarked();
...
private:
...
int marked;
...
};
そして、ここで私はその関数を呼び出そうとしています:
Node **s;
s = &startNode; //startNode is the original pointer to the Node I want to "mark"
q.push(**s); //this is a little unrelated, but showing that it does work to push the original object onto the queue.
**s.setMarked(); //This is where I am getting the error and where most of the question lies.
念のため、.setMarked() 関数は次のようになります。
int Node::setMarked() {
marked = 1;
return marked;
}