Anonymous Monk has asked for the wisdom of the Perl Monks concerning the following question:

how to inserted line in each function of c programe. here i need to identife the each function in give c file and i have to insert print statement in each function at staring and ending of in side function.
  • Comment on how to insert line in c file for each function

Replies are listed 'Best First'.
Re: how to insert line in c file for each function
by toolic (Bishop) on Jul 17, 2012 at 13:30 UTC
Re: how to insert line in c file for each function
by aitap (Curate) on Jul 17, 2012 at 13:31 UTC
    Assuming that every function is wrapped in "{}", you can search for curly brackets, count "{"'s and "}"'s and print the needed string when numbers of "{" and "}" are equal (i.e. this is the most outer loop i.e. this is a function).
    Sorry if my advice was wrong.