Mereg linked lidt problem

#include
using namespace std;
class node{
public:
int data;
node* next;

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

};
void insertattail(node &head ,int data){
node * n=new node(data);
if(head==NULL){
head=n;
return ;
}
node
temp=head;
while(temp->next!=NULL){
temp=temp->next;
}
temp->next=n;

}
void print(node *head){
while(head!=NULL){
cout<data<<" ";
head=head->next;
}
}

void builtlist(node &head,int n){
int data ;
cin>>data ;
insertattail(head,data);
n–;
while(n>0){
cin>>data;
insertattail(head,data);
n–;
}
}
node
merge(node *a,node *b){

	if(a==NULL){
		return b;
	}
	if(b==NULL){
		return a;

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

}

int main() {
int t;
cin>>t;

int n1,n2;
for(int i=0;i<t;i++){
	node * head1=NULL;
node * head2=NULL;
cin>>n1;
builtlist(head1,n1);
cin>>n2;
builtlist(head2,n2);
node* c=merge(head1,head2);
print(c);
cout<<endl;
}
return 0;

}
whats the problem in this code

your code has syntax errors.

updated code: https://ide.codingblocks.com/s/211682

please always try to submit your code in some ide(codingblocks, geeksforgeeks) when you raise a doubt. its difficult to analyze code in this way.

thanks

hackerblocks is sometimes unresponsive, so attempt multiple times.

please rate and resolve if you are satisfied

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.