c stack implementation transposed from handwritten (practice)