Click here to Skip to main content
15,891,423 members

A function that detects the parameter type, value, and the name and return value of another function?

Revision 1
I am wondering if how I can write a function to detect the parameter type, value and function name and return value of another function.

For example. I have a function:

C++
double average(string datapath, double *data, int numofinput)
{
   // some code here
}


I want to have another function, such as detector(), which can be inserted into the function to be detected, like

C++
double average(string datapath, double *data, int numofinput)
{
   detector();
   // some code here
}

and the detector will return:

C++
name: average
returned value: 2.43
pathname: string='C:/Users/Nick/Data/'
data: pointer=0x0065
numofinput: int=1
7

Somthing like that. Any suggestion is highly appreciated. Thanks. Nick
Posted 3-Oct-12 4:20am by Nick Tsui.
Tags: