Having the function definition:
void f(int) { }
I want to define:
int a;
but if the function definition c
One of approaches is to use typedef for the type of the function parameter. For example
typedef int TParm;
void f( TParm );
TParm a;
You can select any name for the type. For example parm_t and so on. It is important that there will not be a name collision.
In this case you will need to change only the typedef if you want to change the type of the parameter.
Or if your compiler supports aliases you can also write
using TParm = int;
void f( TParm );
TParm a;
Also you can wrap the function in a namespace or class.:) For example
struct IFunction
{
typedef int parm_t;
static void f( parm_t = parm_t() ) {}
};
//...
IFunction::parm_t a;
IFunction::f( a );