I have been having a lot of trouble with this and running it through a debugger but I still can't figure out the problem. There is a segmentation fault caused by trying to access a member of an array of pointers, which should be initialized to zero. The line that is causing the issue is below. Any guidance on why this error is occurring would be much appreciated.
class BNode
{
public:
const int m = 6;
BNode();
~BNode();
int keyCount;
BNode **pointers;
int *keys;
void split(int index, BNode *child);
void _insert(int value);
};
BNode::BNode()
{
pointers = new BNode*[m];
cout <<pointers[0]->keyCount; //THIS IS THE TROUBLE LINE**************
keys = new int[m - 1];
keyCount = 0;
}