A class with a pointer to another class

Good day
From the Cookbook of C++ I succeeded in coding this
class node_t {
int name;
} ;
node_t node[100];
class gate_t{
int name;
} ;
class ga: public gate_t
node_t &node_ref1;
ga (node_t &node_sample) : node_ref1 (node_sample){}

Basically ga::node_ref1 is a reference into a node in the program as the following
ga gas[] = {ga(node[0]), ga(node[1])};
ga gate (node[1]);
ga[1].node_ref = node[1];

If later I change the values inside node[1] - then the values of ga[1].node_ref will change
My question is:
I want to add into class ga (( &node_ref2 ))
node_t &node_ref2
How to write the constructor and how to use it?
Any way please...
Topic archived. No new replies allowed.