c assign function pointer to variable -
i have 2 functions,
//virdomain struct int virdomaincreate(virdomain*); int virdomaindestroy(virdomain*); how assign these 2 functions variable?
i tried,
int (*func)(virdomain*) = null; func = virdomaincreate(virdomain*); // not working func = &virdomaindestroy(virdomain*); //not working thanks help! waka.
you can assign pointer function like:
func = &virdomaincreate; or can use short format:
func = virdomaincreate;
Comments
Post a Comment