J
junky_fellow
Guys,
Consider a function
func(void **var)
{
/* In function I need to typecast the variable var as (int **)
I mean to say, I need to access var as (int **)
}
My question is what is the better option, should I use
func(void **var) Or
func(void *var).
I think func(void *) should be fine, as we can store any type of
"pointer variable" in "void pointer variable".
void pointer variable should be big enough to hold any type of pointer
variable.
Is that correct? Or I am missing something?
And if that is correct, should we ever use void ** ?
thanks for any help/response.
Consider a function
func(void **var)
{
/* In function I need to typecast the variable var as (int **)
I mean to say, I need to access var as (int **)
}
My question is what is the better option, should I use
func(void **var) Or
func(void *var).
I think func(void *) should be fine, as we can store any type of
"pointer variable" in "void pointer variable".
void pointer variable should be big enough to hold any type of pointer
variable.
Is that correct? Or I am missing something?
And if that is correct, should we ever use void ** ?
thanks for any help/response.