首页 > 代码库 > 单链表复习
单链表复习
// linklist.cpp : Defines the entry point for the console application.//#include "stdafx.h"#include <string>#include <iostream>using namespace std;struct student{ long number; char name[10]; float score; struct student *next;};int main(int argc, char* argv[]){ struct student a,b,c,*head,*p; a.number=110801; strcpy(a.name,"小明"); a.score=98; b.number=110802; strcpy(b.name,"小华");b.score=100; c.number=110803; strcpy(c.name,"张三");c.score=95; head=&a; a.next=&b; b.next=&c; c.next=NULL; p=head; do { cout<<p->number<<" "<<p->name<<" "<<p->score<<endl; p=p->next; } while (p!=NULL); return 0;}
单链表复习
声明:以上内容来自用户投稿及互联网公开渠道收集整理发布,本网站不拥有所有权,未作人工编辑处理,也不承担相关法律责任,若内容有误或涉及侵权可进行投诉: 投诉/举报 工作人员会在5个工作日内联系你,一经查实,本站将立刻删除涉嫌侵权内容。