Click here to Skip to main content
15,892,005 members
Please Sign up or sign in to vote.
1.00/5 (1 vote)
hi,
I've a very large C program consisting of hundred of files; I want to
know what are all
the global variables defined in the program. how do i do this.

thanks
Posted

1 solution

What you need would be the software tool for static code analysis working with the source C code:
http://en.wikipedia.org/wiki/Static_code_analysis[^].

You can review this list: http://en.wikipedia.org/wiki/List_of_tools_for_static_code_analysis#C.2FC.2B.2B[^].

You can get familiar with some or each of those tools and choose what could work for you; some of them are open-source.

And I would wish you to "have" only the projects which don't require much of such analysis, due to strict architecture and neat implementation. In particular, global variables is generally a bad thing, a sign of bad code and project design. It's quite possible to avoid them or at least minimize.

—SA
 
Share this answer
 

This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)



CodeProject, 20 Bay Street, 11th Floor Toronto, Ontario, Canada M5J 2N8 +1 (416) 849-8900