I'm setting up a program that uses 'DFS' as a child class of 'Search', and calls its base constructor.
The program runs fine, until the breakpoint I placed just after calling the constructor, in which I receive the error:
Exception thrown: read access violation. _Pnext was 0xCCCCCCD0.
I've tried to summarise the code to only what is important.
in main.cpp:
DFS search(gridSize, startPoint, endPoints, walls);
in Search.h:
public:
Search(unsigned int gridSize, unsigned int startPoint, unsigned int endPoints[2], vector<int> walls);
in Search.cpp:
#include "Search.h"
Search::Search(unsigned int gridSize, unsigned int startPoint, unsigned int endPoints[2], vector<int> walls)
{
sGridSize = gridSize;
sStartPoint = startPoint;
sEndPoints[2] = endPoints[2];
sWalls = walls;
}
In DFS.h:
#include "Search.h"
#include <vector>
public:
DFS(unsigned int gridSize, unsigned int startPoint, unsigned int endPoints[2], vector<int> walls);
In DFS.cpp:
#include "DFS.h"
DFS::DFS(unsigned int gridSize, unsigned int startPoint, unsigned int endPoints[2], vector<int> walls) : Search(gridSize, startPoint, endPoints, walls)
{
}
If any more code is needed to understand this, just ask - I'm worried about pasting in too much.
Any help is greatly appreciated :)