You defined an object of type Stack<student>. This means that the template argument has type student. Member function push is declared as
bool push(S);
that is it accepts an argument of type student. However you call it passing an argument of type student *
varD.push(d);
d has type student *
So either you should define the Stack as having template argument as student * or use an object of type student instead of student * as the argument in the call