I wrote the following code in java :
class node{
int key;
node left ,right;
public node(int item ){
key = item;
left = right = NULL;
}
it works fine in java but when i try to implement the same thing in c++ , it shows an error saying,"error: field 'left' has incomplete type 'node'". Can anyone explain how is this happening ? and what can i do to remove this error? i want to know how these two languages are implementing this.