Find function parameters

Hi,

For each variable, I want to figure out whether it is a parameter or not. How should I do that?

For example, in the next function, I want to know that variable ‘i’ is a parameter, and ‘var’ is a variable.

int test (int i) {

int var;

var = 2*i;

return var;

}

Thanks in advance.

lucefe

Hi,

you can iterate over a function’s formal parameters via Function::arg_iterator.

Regards,
Victor.