How to do perform functionality analysis of C/C++ source files

  c++, code-analysis, static-code-analysis

I want to do code analysis of C/C++ source files.

I need a tool that can check for a specific functionality in a source file. For example, checking, is a particular source code is reading a file? Give the source code below containing a line which is actually writing a file so It should detect that line.


In above case, the tool should just detect

I have seen there are many static code analysis tools, but they just focus on finding bugs or unused variables etc.

Any idea how can I get the desired output? Thanks.

Source: Windows Questions C++