|
|
On 14 Jun 1999 01:34:36 -0400, Nieminen Mika wrote:
>Ronald L. Parker <par### [at] mailfwicom> wrote:
>: BTW, I have a minor bone to pick with you. Please don't use // to
>: comment things in your code. GCC doesn't like it, and many other C
>: compilers don't either.
>
> Tip: If you want to automatically enclose those comments with /* ... */,
>you can try this sed command:
> sed "s/\/\/.*$/\/*&*\//" file.c
>
> (Cryptic, uh? :) )
less cryptic, and with a backup:
mv file.c file.c.bak; perl -pe "s#//(.*)$#/* $1 */#" <file.c.bak >file.c
Both methods would fail if the // comment happened to contain the '*/'
sequence of characters, but that's rare.
Post a reply to this message
|
|