Check out Beyond Compare. It's good for this and a whole lot more. $30 and worth every penny.
Update: Yes, it works for the problem stated. Do the following:
- Session > New > Folder Compare
- Pick you left and right folders.
- Set your filter rules. There are a few predefined rule sets, including C++ Source, which has
"*.cpp;*.hpp;*.c;*.h;*.cc". Note you can name and save your filter sets so you only have to define them once.
- You can now pick "compare for equal", "compare for not equal", "sync left", "sync right", etc., etc.
- You can save the session and rerun it again with a couple of clicks.
This program also works great for doing targeted backups. If it hits a file that it can't copy, it notes it in the message box and keeps rolling, unlike Windows copy which dies on the first error.
They have a non-crippled 30 day trial.
Ps. I know I probably sound like a shill for Scooter Software, but I'm not. I'm mostly an old Unix hacker who every once in a while has a need for decent compare/sync for Windows machines.