typedef struct _node btree_node;

struct _node
{
	int* keys;
	btree_node* children;
	int count_keys;
	int is_leaf;
	btree_node* parent;
	int position_in_parent;	
};

I am getting this error:

error: no match for ‘operator=’ in ‘*(node->_node::children + ((long unsigned int)(((long unsigned int)(i + degree)) * 40ul))) = 0l’
note: candidates are: _node& _node::operator=(const _node&)

for this line of code:

node->children[i+degree] = NULL;

I failed to explicate the reason behind this.

Note: I used g++ to compile this. How to change things to compile without error for g++?

Recommended Answers

All 2 Replies

I figured my stupid silly mistake. children[i+degree] is not a pointer. What punishment do you suggest to give johndoe for such a moronic act?

I figured my stupid silly mistake. children[i+degree] is not a pointer. What punishment do you suggest to give johndoe for such a moronic act?

How about getting you to post this in the C++ section

Note: I used g++ to compile this. How to change things to compile without error for g++?

commented: Yes +2
Be a part of the DaniWeb community

We're a friendly, industry-focused community of developers, IT pros, digital marketers, and technology enthusiasts meeting, networking, learning, and sharing knowledge.