For my lexical analysis program (which reads in one char at a time from file with getChar) I have a getToken function that determines (then returns) a token for any character being read it also sets the lexeme (string). Once it reads this in, it outputs a string version of the token and its corresponding lexeme.
However, for the comment token case (// or */ which is shown below) the output from the command prompt is giving me problems. It always freezes right as I reach the // or */ in the file, then if i press enter it will skip the comment signifier as expected, but will still print out the corresponding letters and words as id's. Since they're in a comment, they should've been skipped
Is there anything within the code below that can be changed to fix this?