typedef struct node{
int data;
struct node *next;
}Lnode,*List;
void insert(List p,List q){
if(p == NULL)exit(0);
else
{
q->next = p->next;
p->next = q;
}
}
根据楼主的意思,写了这个这个函数,不过感觉那个参数列表不是很对的样子,因为缺个表头,但你又没说- -
你的操作有疑问,q插到p后,那q前面的结点呢,p后面的呢,
如果q是第一个,p是最后一个,那就没问题,直接:p->next=q
node * tmp1 = p->next;
p->next = q;
q->next = tmp1;