maredit测试

int main()
{

}
void addTotail(ListNode *& pHead, int value)
{
	ListNode *node = new ListNode();
	node->value = value;
	node->pNext = NULL;

	ListNode *p = pHead;

	if (p == NULL)
	{
		pHead = node;		
		return;
	}
	while (p->pNext != NULL)
	{
		p = p->pNext;
	}

	p->pNext = node;
}

posted on 2014-07-13 11:49  zjgtan  阅读(213)  评论(0编辑  收藏  举报

导航