Tree right view

what is wrong with this code?
#include<bits/stdc++.h>
using namespace std;
class Node{
public:
int data;
Nodeleft;
Node
right;

Node(int d){
    data = d;
    left = NULL;
    right = NULL;
}

};
NodebuildTree(){
int d;
cin>>d;
if(d==-1){
return NULL;
}
Node
root = new Node(d);
root->left = buildTree();
root->right = buildTree();
return root;
}
void printRight(Noderoot){
if(root==NULL){
return;
}
cout<data<<" “;
printRight(root->right);
//cout<data<<” ";
return;
}
int main(){
Node
root=buildTree();
printRight(root);
cout<<endl;
return 0;
}

@avinashmallik2017,
Please make sure you share Coding Blocks IDE link of your code. It would be a great help to us and you will be able to get your doubts resolved in lesser time too.

You are not considering a case like this:

        1
       / \
      2   3
     /\   /\
    4  N  N N

This should print 1,3 4. But your program would print 1,3.