The bottom half of Re: C comment stripping preprocessor (problems) contains a Perl script that strips C-style and C++-style comments from C and C++ code. Note that you should initialize $canNest= 0 as C/C++ don't allow nesting of C-style comments. You might also want to manipulate whitespace so you can ignore difference in whitespace only outside of quoted strings.
- tye
In reply to Re: How to know if two files (.c,.h,.cpp) are different content-wise ignoring the comments? (perl)
by tye
in thread How to know if two files (.c,.h,.cpp) are different content-wise ignoring the comments?
by iphone
| For: | Use: | ||
| & | & | ||
| < | < | ||
| > | > | ||
| [ | [ | ||
| ] | ] |