struct noInterno
{ int num_elems;
// noInterno* pai[2];
int chaves[4];
void* filhos[5];
bool isLeaf;
int h;
};
struct noFolha
{
int num_elems;
Regist* array[4];
noFolha* prev;
noFolha* next;
bool isLeaf;
int h;
};
noFolha* arvbmais::procura_noFolha(int elem, void* root)
{ noFolha* a = (noFolha*) root;
noInterno* b = (noInterno*) root;
if( (noFolha*) root->isLeaf )
return root;
it gives me these errors:
In member function `noFolha* arvbmais::procura_noFolha(int, void*)':
`void*' is not a pointer-to-object type
invalid conversion from `void*' to `noFolha*'
i want to know how to reference it to a noFolha, and when I need, how to reference root to noInterno?
Your error is due to you trying to return "root", which is a void pointer, at then end of your member function when you declared that the function would return a "noFolha" pointer.
Why are you casting data types anyway? There are far better ways to do this in C++ depending on your requirements.
I need to do a b+tree implementation, and i thought this kind of approach would be the best in terms o space.
Could kindly explain me which are the other ways to do it?
A B+ tree has two kind of nodes, leaf node and intern node, so I need a simple way to reference the kind of node that i will be using
Thanks for the help