
list.h
By: a guest on
Feb 27th, 2012 | syntax:
None | size: 0.68 KB | hits: 16 | expires: Never
#ifndef LIST_H
#define LIST_H
class List
{
public:
List();
~List();
void insert_at_end(int value);
void insert(int value); // insert at beginning of list
void print();
int sum();
int m_value;
private:
class Node
{
public:
// small functions can be inserted into the class definition
// don't put large functions in the class definition
Node(int value, Node *next)
{m_value = value; m_next = next;}
int m_value;
Node *m_next;
};
Node *m_head;
};
#endif