how to count number of functions in c program

  • Thread starter saravanan.linux
  • Start date
S

saravanan.linux

Hello,
How to count, "Total Number of functions in c program". Is any tool
availabel.
ThankX in advance
Yours
Saravanan.
 
R

Randy Howard

Hello,
How to count, "Total Number of functions in c program". Is any tool
availabel.
ThankX in advance
Yours
Saravanan.

Well, if you have source code formatted properly (*ahem*), then all
of your functions start with a { in column 1 and nothing else does,
like this...

int foo(void)
{

So, grep "^{" *.c | wc -l should do the trick.
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Members online

Forum statistics

Threads
474,159
Messages
2,570,888
Members
47,420
Latest member
ZitaVos505

Latest Threads

Top