Want a way to strip comments from a

Joe English jeenglis at nunki.usc.edu
Mon Mar 20 09:51:03 AEST 1989



I made a mistake in the comment-eating program I
posted yesterday -- it won't handle

/* something like *//* this. */

Change the line in the '/' case from:

    if ((ch = getchar()) == '*') { eatcomment(); ch=getchar(); }

to:

    if ((ch = getchar()) == '*') { eatcomment(); ch=getchar(); continue; }

and it will work.  If anyone's interested.


--Joe English

  jeenglis at nunki.usc.edu



More information about the Comp.lang.c mailing list