C++类,链表,长度,该如何处理

C++类,链表,长度
我用C++的类方法写了一个线性链表的程序,但是我在求链表的时候遇到了问题
下面是我的代码
(为了节省大家的时间,我只列出了部分代码)

#include<iostream>
using namespace std;

class IntNode
{
public:
int info;
IntNode *next;
IntNode(int el,IntNode*ptr=0)
{
info=el;
next=ptr;
}
};




class IntSLList
{
public:
IntSLList()
{
head=tail=0;
}
~IntSLList();
int isempty()
{
return head==0;
}
void addToHead(int);
void addToTail(int);
int deleteFromHead();//delete the head and return it's value;
int deleteFromTail();//delete the tail and return it's value;
int getLength();
void deleteNode(int);
void printLink() const;
bool isInList(int) const;

private:
IntNode *head,*tail;
};


void IntSLList::addToHead(int n)
{
  head=new IntNode(n,head);
if(tail==0)//this is the special circumstances;
tail=head;
}


int IntSLList::getLength()
{
return tail-head;
}


#include "IntSLList.h"
#include<iostream>
using namespace std;


int main(void)
{
IntSLList test;
int target=0;
  cout<<"Please input the number you want to find\n";
cin>>target;
for(int i=1;i<=20;i++)
test.addToHead(i);
cout<<"The length of the linklist is "<<test.getLength()<<endl;
test.printLink();
test.~IntSLList();

return 250;
}

答案居然是974,相差太远了,我不知到时怎么回事,所以想请高手解决。





------解决方案--------------------
还是++,自己定义比较好。
add时size++。