按照自己的想法和思路写了一下带头结点的单链表，并进行了测试，毕竟自己能力有限，可能有的地方没有测试到，还可能存在一些潜在的错误。
头文件：

#include <iostream>
using namespace std;

typedef struct Node
{//结点结构
int value;
struct Node * next;

typedef struct List
{
int length;

{//新建一个空链表
list=new List;//为链表指针分配空间
cout<<"Failed."<<endl;
list->tail->next=NULL;
list->length=0;
return list;
}

int ListLength(List list)
{
return list.length;
}

bool IsEmptyList(List list)
{
if(list.length==0)
return true;
return false;
}

{
p=new Node;
p->value=elem;
if(IsEmptyList(*list))
{
list->tail=p;
p->next=NULL;
}
else
{
}
++list->length;
}

{
p=new Node;
p->value=elem;
p->next=NULL;//
if(IsEmptyList(*list))
{
list->tail=p;
}
else
{
list->tail->next=p;
list->tail=p;//改变表尾指针
}
++list->length;
}

{
if(pos<1 || pos>ListLength(*list)+1)
cout<<"The position is invalidate."<<endl;
else
{
if(pos==1)
{
}
else if(pos==ListLength(*list)+1)
{
InsertElemToEnd(list,elem);
}
else
{
p=new Node;
p->value=elem;
for(int i=1;i<pos-1;++i)
{//找到第pos-1个结点
q=q->next;
}
p->next=q->next;
q->next=p;
++list->length;
}
}
}

{
if(IsEmptyList(*list))
{//表空
cout<<"The list is empty,you can't delete element."<<endl;
}
else
{//表非空
if(ListLength(*list)==1)
{//表长为1
elem=p->value;
free(p);
}
else
{
elem=p->value;
free(p);
}
--list->length;
}
}

{
if(IsEmptyList(*list))
{
cout<<"The list is empty,you can't delete element."<<endl;
}
else
{
if(ListLength(*list)==1)
{
elem=p->value;
free(p);
}
else
{
q=list->tail;
while(p->next!=q)
p=p->next;//找到表尾的前一个结点
list->tail=p;
p->next=NULL;
elem=q->value;
free(q);
}
--list->length;
}
}

{
if(pos<1 || pos>ListLength(*list))
cout<<"The position is invalidate."<<endl;
else
{
if(pos==1)
{
}
else if(pos==ListLength(*list))
{
DeleteElemFromEnd(list,elem);
}
else
{
for(int i=1;i<pos-1;++i)
{//找到第pos-1个结点
q=q->next;
}
p=q->next;
q->next=p->next;
elem=p->value;
free(p);
--list->length;
}
}
}

bool PreElem(List list,int pos,int &elem)
{//返回pos位置处的前驱
if(!IsEmptyList(list))
{
if(pos<1 || pos>ListLength(list))
{
cout<<"The position is invalidate."<<endl;
return false;
}
else if(pos==1)
{
cout<<"This position doesn't have pre_element."<<endl;
return false;
}
else
{
for(int i=1;i<pos-1;++i)
{
p=p->next; //找到pos-1位置
}
elem=p->value;
return true;
}
}
}

bool NextElem(List list,int pos,int &elem)
{//返回pos位置处的后继
if(!IsEmptyList(list))
{
if(pos<1 || pos>ListLength(list))
{
cout<<"The position is invalidate."<<endl;
return false;
}
else if(pos==ListLength(list))
{
cout<<"This position doesn't have next_element."<<endl;
return false;
}
else
{
for(int i=1;i<pos;++i)
{
p=p->next;//找到pos位置
}
elem=p->next->value;
return true;
}
}
}

bool CurrentElem(List list,int pos,int &elem)
{//得到pos位置处的元素
if(!IsEmptyList(list))
{
if(pos<1 || pos>ListLength(list))
{
cout<<"The position is invalidate."<<endl;
return false;
}
else
{
for(int i=1;i<pos;++i)
{
p=p->next;//找到pos位置
}
elem=p->value;
return true;
}
}
}

{//如果链表不空，则返回表头元素，用elem接收
if(IsEmptyList(list))
{
cout<<"The list is empty."<<endl;
return false;
}
else
{
return true;
}
}

bool GetTail(List list,int &elem)
{//如果链表不空，则返回表尾元素，用elem接收
if(IsEmptyList(list))
{
cout<<"The list is empty."<<endl;
return false;
}
else
{
elem=list.tail->value;
return true;
}
}

{//清空链表并释放所有结点空间
if(!IsEmptyList(*list))
{
while(p!=list->tail)
{//释放每个结点空间
q=p->next;
free(p);
p=q;
}
free(p);//释放尾结点
list->length=0;
}
}

{//销毁链表
ClearList(list);//先清空链表
}

void VistElemOfList(List list)
{//遍历链表，输出链表元素
if(!IsEmptyList(list))
{
while(p)
{
cout<<p->value<<' ';
p=p->next;
}
}
cout<<endl;
}
测试代码：

#include "stdafx.h"
#include <conio.h>
#include "list.h"

int _tmain(int argc, _TCHAR* argv[])
{
list=NewList();
if(IsEmptyList(*list))
cout<<"The list is empty."<<endl;
cout<<"The length of the list is:"<<ListLength(*list)<<endl;
ClearList(list);
InsertElemToEnd(list,10);
InsertElemToEnd(list,22);
InsertElemToEnd(list,36);
VistElemOfList(*list);
int e;
{
cout<<"The head_elem of the list is:"<<e<<endl;
}
if(GetTail(*list,e))
{
cout<<"The head_elem of the list is:"<<e<<endl;
}
cout<<"The length of the list is:"<<ListLength(*list)<<endl;
InsertElemToList(list,3,21);
InsertElemToList(list,1,88);
InsertElemToList(list,8,99);
InsertElemToList(list,10,100);
VistElemOfList(*list);
cout<<"The length of the list is:"<<ListLength(*list)<<endl;
int elem;
DeleteElemFromEnd(list,elem);
VistElemOfList(*list);
cout<<"The length of the list is:"<<ListLength(*list)<<endl;
VistElemOfList(*list);
cout<<"The length of the list is:"<<ListLength(*list)<<endl;
{
cout<<"The head_elem of the list is:"<<e<<endl;
}
if(GetTail(*list,e))
{
cout<<"The head_elem of the list is:"<<e<<endl;
}
DeleteElemFromList(list,4,elem);
VistElemOfList(*list);
cout<<"The length of the list is:"<<ListLength(*list)<<endl;
DeleteElemFromList(list,1,elem);
VistElemOfList(*list);
cout<<"The length of the list is:"<<ListLength(*list)<<endl;
DeleteElemFromList(list,ListLength(*list)+1,elem);
VistElemOfList(*list);
int temp;
if(PreElem(*list,1,temp))
{
cout<<"The pre_element of this position is:"<<temp<<endl;
}
if(PreElem(*list,2,temp))
{
cout<<"The pre_element of this position is:"<<temp<<endl;
}
if(NextElem(*list,1,temp))
{
cout<<"The next_element of this position is:"<<temp<<endl;
}
if(NextElem(*list,ListLength(*list),temp))
{
cout<<"The next_element of this position is:"<<temp<<endl;
}
if(CurrentElem(*list,2,temp))
{
cout<<"The cur_element of this position is:"<<temp<<endl;
}
if(CurrentElem(*list,12,temp))
{
cout<<"The cur_element of this position is:"<<temp<<endl;
}
ClearList(list);
VistElemOfList(*list);
getch();
return 0;
}