comments longer than one line

&& means boolean AND the test for equality is == not =,

You would need to have each indicator tested individually.

if ((c == "") && (c == '*') && (c == '\n'))

Of course this would always generate FALSE as it is an impossible statement.

Even if the line worked the way you think, it would always be false as you seem to test c against slash AND asterix AND new line which is impossible. You need to check against slash set a flag and check if the next character is asterix Then verify that there is a new line before the end of the comment (*/)

// can span multiple lines and you need to check that the /* is not inside a // and vice versa.

Browse More Popular Posts

Leave a Comment