代码如下:-----------------------h文件:#pragmaoncetypedefintDataType;typedefstructnode{DataTypedata;structDataType*next;}Node;classMyList{private:DataType*HeadNode;publi...
代码如下:
-----------------------
h文件:
#pragma once
typedef int DataType;
typedef struct node
{
DataType data;
struct DataType *next;
}Node;
class MyList
{
private:
DataType *HeadNode;
public:
MyList();
~MyList();
DataType* InsertAtHead(DataType data);
DataType* InsertAtTail(DataType data);
//private function
};
---------------------------------
cpp文件:
#include "MyList.h"
DataType* MyList::InsertAtHead(DataType data)
{
return 0;
}
--------------------------------
<