All pastes #56423 Raw Edit

Untitled

public text v1 · immutable
#56423 ·published 2006-05-16 23:25 UTC
rendered paste body
#ifndef LIST_H
#define LIST_H
class node
{
public:
	node(){nxt = NULL;}
	node(Time tmp){val = tmp; nxt = NULL;}
	~node(){delete nxt;}

	string fname;
	Time val;
	node *nxt;
};

class list
{
public:
	list(){head = tail = NULL;}
	~list(){delete head;}

	void add(Time tmp)
	{
		if (this->tail) this->tail = this->tail->nxt = new node(tmp);
		else this->head = this->tail = new node(tmp);
	}

	node *head;
	node *tail;
};
#endif