list.h

来自「浙江工业大学C++数据结构课程设计的练习作品 有一定的难度 有英文原题说明(老外」· C头文件 代码 · 共 49 行

H
49
字号
/*  list.h - Robert Ollington - 1/8/05
    (based upon Mike Cameron-Jones' C implementation for KXA251)
    
    This is just the header file for the functions implemented in list.cpp

    It illustrates the use of #ifndef and #define that prevents the definitions
    being included twice when the file itself is included twice by mistake.
*/

#ifndef _LIST_H
#define _LIST_H
#include "student.h"

/* Define node type */
class node
{
public:
    Student data_item;
    node* next;

	node();
	node(Student n);
	//~node();
};

class list
{
private:
	node* first;

public:
	/* Constuctor and Destructor */
	list();
	~list();

	/* Function to insert n at front of list */
	void insert_at_front(Student n);

	/* Function to print list */
	void print();

	int getCount();

	/* Function to insert n in (non-decreasing) order in list - assuming list 
	items are already in (non-decreasing) order. */
	//void insert_in_order(int n);
};

#endif

⌨️ 快捷键说明

复制代码Ctrl + C
搜索代码Ctrl + F
全屏模式F11
增大字号Ctrl + =
减小字号Ctrl + -
显示快捷键?