#include
using namespace std;
typedef struct datatpye
{
int num;
struct datatpye *next;
}DA;
void InitData(DA &h1, DA &h2); //初始化两个链表
void ShowData(DA &head); //显示一个线标里的数据
int main()
{
DA head1, head2;
InitData(head1,head2);
ShowData(head1);
return 0;
}
void InitData(DA & h1, DA & h2)
{
DA m1,m2,m3;
DA n1,n2,n3,n4;
m3.next = NULL; m3.num = 7;
m2.next = &m3; m2.num = 5;
m1.next = &m2; m1.num = 1;
h1.next = &m1;
n4.next = NULL; n4.num = 19;
n3.next = &n4; n3.num = 11;
n2.next = &n3; n2.num = 6;
n1.next = &n2; n1.num = 0;
h2.next = &n1;
}
void ShowData(DA & head)
{
DA *h = head.next;
while(h)
{
cout<
h = h->next;
}
cout<<"\b\b\n"<