title: Error checking not being properly displayed
body: <p>After spending more than few days on debugging, I can't find the reason why my code below creates additional spaces when printing out the error check ("expecting or missing"). For example, when I run each of these line of symbols one at a time in order.</p>
  
  <p>The first two works fine, but the third line of input will error check at the wrong position. But the symbol that its expecting is correct (&lt;). When I remove the call to the reset function in the bottom of my code, the error check of the third line of input will be at the correct position but the symbol that its expecting is incorrect: { . Most likely because the stack hasn't reseted from the previous line of inputs. </p>
  
  <p>I made print statements on the values of the increments for printing spaces and the size of the char array itself, but the numbers are correct. The culprit might be the reset function I made, but the character resets fine. Only problem is that the output is creating additional spaces when printing out the error check, which leads to displaying the error check at the wrong position.</p>