I was working on the problem Tower of Hanoi and thus implemented a stack based version of tower of Hanoi, however I'm not sure whether my implementation follows all the rules of tower of Hanoi. it works for all the cases but I want to verify it here. P.S my stack is not a template but will only work for int data type.
void moveDiscs(int num,Stack& source, Stack& destination, Stack & auxillary)
{
if (num > 0)
{
int temp;
moveDiscs(num - 1, source, auxillary, destination);
//------------------------------------
source.pop(temp);
destination.push(temp);
//------------------------------------
moveDiscs(num-1, auxillary, destination, source);
}