NoobsDeSroobs

C++ pointer and nulling problems

Jun 2nd, 2014
710
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
C++ 0.74 KB | None | 0 0
  1. struct Node
  2. {
  3.     struct Node** adjacencies;
  4.     bool* paths = new bool[4];
  5.     bool visited;
  6.     int x;
  7.     int y;
  8.  
  9. };
  10.  
  11.  
  12. //Here I initialize the map with all the nodes.
  13. Node_map::Node_map(int x_size, int y_size)
  14. {
  15.     setHeight((y_size / 2));
  16.     setWidth((x_size / 2));
  17.     map = new Node[getWidth()*getHeight()];
  18.     size = getWidth() * getHeight();
  19. }
  20.  
  21. //Here I wanted to set the stage for the calculations by resetting all values to default.
  22. bool* processed = new bool[numNodes];//To quickly check whether each node has been processed or not.
  23. Node* testList = new Node[numNodes];
  24.  
  25. int startIndex = 0;
  26.  
  27. for (int i = 0; i < numNodes; i++) {
  28.     processed[i] = false;
  29.     testList[i] = NULL; //Here I get the error complaining about no matching operator.
  30. }
Advertisement
Add Comment
Please, Sign In to add comment