实现基本初始化、插入、删除、遍历操作。
#include<stdio.h>
#include<iostream>
#include<string.h>
using namespace std;
#define MAX 100
#define OK 1
#define ERROR 0
typedef int status;
typedef struct
{
int C;
int Math;
}Score;
typedef struct
{
char name[20];
char ID[20];
Score sc;
}Student;
typedef struct node
{
Student std;
struct node* next;
}Node,LinkedList;
status Initial(LinkedList* & head)
{
head = new LinkedList;
if (!head)
return ERROR;
head->next = NULL;
return OK;
}
status Insert(LinkedList*& head, Student std)
{
Node* p = new Node;
if (!p)
return ERROR;
p->std = std;
p->next = NULL;
Node* temp = head;
while (temp->next != NULL)
{
temp = temp->next;
}
&

这是一个使用C++和单链表实现的学生信息管理系统,具备录入、删除和遍历学生信息的功能。用户可以选择进行录入学生信息、删除学生信息或查看所有学生信息的操作。系统通过VS2019编译,具有无限循环,直到用户选择退出。
最低0.47元/天 解锁文章
8226





