C program to print the function names defined in the source code
All Answers
total answers (1)
Severity: 8192
Message: str_replace(): Passing null to parameter #3 ($subject) of type array|string is deprecated
Filename: libraries/Filtered_db.php
Line Number: 23
total answers (1)
In this program, we will use __FUNCTION__ macro to print the function name, also we will print all function names defined in the source code.
__FUNCTION__ Macro:
This macro is used to return the current function name. It is useful for debugging i.e., to generate the logs.
Program:
The source code to print the function names defined in the source code is given below. The given program is compiled and executed using GCC compile on UBUNTU 18.04 OS successfully.
Output:
Explanation:
In the main() function, we called func1(), func2(), func3() function and print the function names using __FUNCTION__ macro on the console screen.
need an explanation for this answer? contact us directly to get an explanation for this answer