in reply to How to know if two files (.c,.h,.cpp) are different content-wise ignoring the comments?

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        

  • Comment on Re: How to know if two files (.c,.h,.cpp) are different content-wise ignoring the comments? (perl)
  • Download Code