top button
Flag Notify
    Connect to us
      Site Registration

Site Registration

List of functions defined in a C code file?

+3 votes
673 views

How to get the list functions defined in a c source file?

posted Oct 7, 2014 by Dilbagh

Share this question
Facebook Share Button Twitter Share Button LinkedIn Share Button
compile the source code and then run the nm command on the object file...
Did you mean to get list of functions defined in a file through command line.. Can you please put more light on question..?
@Aarti: Say my file has 10 functions declaration and definition and want to get the list of those. What would be the best way.

1 Answer

+1 vote

Yeah.. as Salil sir answered , we can find it out by using nm command.
nm "object file name"
If we are not giving file name,by default it will take a.out.

This command will generate a symbol table.
And function names are preceding by "T" in that symbol table.
As "T" The symbol is in the text (code) section.

answer Oct 7, 2014 by Aarti Jain
...