CODE FAILED TO COMPILE

Sir the code is compiling and giving right output on gdb compiler, but here it is failing to compile.
#include
using namespace std;

class node
{
public:
int data;
node *next;

node(int d)
{
    data=d;
    next=NULL;
}

};

void Display(node *p)
{
while(p!=NULL)
{
cout<data<<" ";
p=p->next;
}
cout<<endl;
}

node * Create(node *head,int n)
{
int ele;
cin>>ele;
head=new node(ele);
node *last=head;

for(int i=0;i<n-1;i++)
{
    cin>>ele;
    node *t=new node(ele);
    last->next=t;
    last=t;
}
return head;

}

node * merge(node *a,node *b)
{
if(a==NULL)
return b;

if(b==NULL)
  return a;

node *c;

if(a->data<b->data)
{
    c=a;
    c->next=merge(a->next,b);
    
}
else
{
    c=b;
    c->next=merge(a,b->next);
}

}

int main()
{
int t;
cin>>t;
while(t>0)
{
node *head1=NULL;
node *head2=NULL;

    int n1,n2;
    cin>>n1;
    node *a=Create(head1,n1);
    
    cin>>n2;
    node *b=Create(head2,n2);

    node *c=merge(a,b);
    Display(c);
    t--;
}

}

hi @Mukul-Shane-1247687648773500, corrected and commented https://ide.codingblocks.com/s/663070

I hope I’ve cleared your doubt. I ask you to please rate your experience here
Your feedback is very important. It helps us improve our platform and hence provide you
the learning experience you deserve.

On the off chance, you still have some questions or not find the answers satisfactory, you may reopen
the doubt.