Hm, ok that seems to be a fair requirement I guess. I've made some mockup code for a stack class just for experiment. Does this look ok?

Code:

#ifndef STACK_H
#define STACK_H
#include <stdlib.h>
template <class T> class Stack{
private:
struct node{
T data;
node *next;
};
node *head;
size_t items;
// destroy the stack
void trash_stack(){
while(this->size())
this->pop();
}
public:
Stack() : items(0), head(NULL) {}
~Stack(){
trash_stack();
}
const size_t size(){
return items;
}
void push(const T& data){
node *n = new node;
n->data = data;
n->next = NULL;
if(head){ // if stack is not empty!
n->next = head;
head = n;
items++;
} else {
head = n;
items++;
}
}
T pop(){
T tmp = T();
node *n;
if(head){
n = head;
tmp = n->data;
head = n->next;
delete(n);
items--;
return tmp;
} else { // stack is empty
return NULL;
}
}
};
#endif