Click here to Skip to main content
15,878,676 members
Please Sign up or sign in to vote.
0.00/5 (No votes)
See more:
Hi, i have to write C# class and method from C codes. My C codes are below. function_ex takes function pointer which takes custom_pac_type_t pointer.Problem is about method declaration. i can't use Func<> cause there is a ref parameter. I must use delegates but i couldnt. How can i pass func pointer to function_ex method. Thanks

What I have tried:

c code:
C++
typedef struct
{  
 void (*fp )(custom_pac_type_t* pac_variable);
}
custom_hab_type_t;

void function_ex(void(*fp_function)(custom_pac_type_t* pac_variable))
{  
 custom_hab_type_t->fp = fp_function;
}
Posted
Updated 4-Oct-17 4:10am

1 solution

 
Share this answer
 

This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)



CodeProject, 20 Bay Street, 11th Floor Toronto, Ontario, Canada M5J 2N8 +1 (416) 849-8900