Want a way to strip comments from a

Joe English jeenglis at nunki.usc.edu
Tue Mar 21 06:18:22 AEST 1989


In article <9797 at megaron.arizona.edu> you write:
>It still doesn't work.  It won't uncomment itself.  Or the following line:
>
>	'"' /* hi there */ '"'
>

Thanks -- I had a feeling I was forgetting something.
I wrote an uncomment program a couple years ago
(and I swear, it *did* work and it wasn't too hard
to write :-)  and I was trying to recall it from 
memory.  Characters in single-quotes were the other
case I forgot about -- and if I had tested the program
on it's own source I would have caught that oversight.
(I feel really stupid now... I think I'm going to 
stop posting to this newsgroup, as I have failed to
say anything correct or intelligent for about a 
month now.)

The Lex solution posted is much more elegant and 
simple; but since lex isn't universally available
a C version is also useful...  (I'm not going to
try a third time, though.)

--Joe English

  jeenglis at nunki.usc.edu



More information about the Comp.lang.c mailing list