I have to pass a double pointer to a function
struct Animal{
uint_32 *count;
}
struct forest{
struct Animal elephant;
}
void pass(uint32 **count){
printf("Count:%d\n",**count);
}
int main(){
struct forest *gir;
gir=(struct forest*)malloc(sizeof(struct forest));
gir.elephant.count=(int*)malloc(sizeof(uint32_t));
pass(_______); //have to pass count value
return 0;
}
I have tried various combos but not sure how to handle this case.
kindly note, I have directly written it on SO, as putting up actual code would be unnecessarily complicating, as I am only looking for specific solution.