I'd normally structure the code more like this:
template <class T>
class stack {
class node {
T data;
node *next;
node(T const &i, node *n=NULL) : data(i), next(n) {}
};
node *top;
public:
void push(T const &in) {
top = new node(in, top);
}
stack() : top(NULL) {}
};
With this general structure, you get only one top per stack (instead of one in each node), but you can still create as many stack objects as you want (something that won't work if you make top a static or global).
I've left pop un-implemented for the moment because it's really somewhat tricky to get correct. In particular, the typical definition of pop that removes the top item from the stack and returns its value can't be made exception safe unless you place some fairly tight restrictions on the data that can be stored. The stack class in the standard library takes the route of separating the two actions -- one function to get the value of the top-most item, and a second to remove the top item from the stack.
It's not at all clear to me whether you'd really prefer to do that, or stick with a design that's easy to use, but may be unsafe.
I see a couple of problems with your print. First of all, it leaks memory -- it allocates an object, and attempts to delete it, but before the delete, the pointer has been set to NULL, so the delete is a nop. I think that's a direct consequence of the second problem: it's really quite a bit more complex than necessary. I'd normally use something closer to this:
void print() {
for (node *p=top; p!=NULL; p=p->next)
std::cout << p->data << "\n";
}
One more possibility to consider would be to implement the stack as a linked list of nodes, but have each node capable of holding a number of items instead of just one. This can reduce the overhead of the pointers quite a bit (e.g., as your code is written right now, in a typical implementation you have twice as much space devoted to pointers as to the data).