I have a Network class which includes vectors of Nodes which includes vectors of int.
I want to print out all of int . Here is what i did . HOwever i cannot access , i take such an error:
std:vector<int> adjacencyList is private;
HOw can i access there ? I have no permission to change class declarations(adding extra method into the classes is forbidden).How can i do it?
friend ostream& operator<<(ostream& stream,Network& network);
vector<Node *> nodes;
ostream& operator<<(ostream& stream, Network& network)
int s = network.nodes.size();
js = network.nodes[i]->adjacencyList.size() ;
for (int j=0;j<js;j++)
cout << network.nodes[i]->adjacencyList[j] ;