Premkumar U
Premkumar U

Reputation: 115

How to count number of functions in a C++ projects?

Is there any tool that analyse and reports number of functions (including member functions) in a C++ project?

I need to replace a global variable with a class member in a VC++ project. Then I need to introduce a local reference that points to new class member in functions that uses the global variable, so that the project compiles successfully. For that I need to calculate number of functions in that project. Then I can roughly calculate the time taken to do the change.

Upvotes: 2

Views: 5232

Answers (2)

MSalters
MSalters

Reputation: 179779

Since it's a VC++ project: generate a .MAP file. That lists every function; just count them.

Upvotes: 1

TemplateRex
TemplateRex

Reputation: 70516

You could use a static code analysis tool like LOC Metrics. It will count lines of code per function and output it to a .csv file. The number of lines in this output file is equal to the number of functions in your project.

Upvotes: 4

Related Questions