c++学习-链表

静态链表:

#include<iostream>
#include<string>
using namespace std; struct book{
int num;
float price;
struct book *next;
}; int main()
{
book x, y, z, *head, *p;
x = {,1.1f};
y = { , 2.2f };
z = { , 3.3f }; head = &x;
x.next = &y;
y.next = &z;
z.next = NULL; p = head;
while (p!=NULL)
{
cout << p->num<<'\t'<<p->price << endl;
p = p->next;
}
return ;
}
上一篇:12月centos单词


下一篇:Angular6之ng build | ng build --aot | ng build --prod 差异