M
manu
Hi all,
I have a query regarding the passing of pointers of different types to
a function using single parameter at same time.
Suppose i have
struct type1 abc;
struct type2 xyz;
My intention is to pass the address of the structures to a function.
I tried
- Before the invocation a void pointer array is initialised.
void *ptr[2] = {
(void *)&abc,
(void *)&xyz
}
Invoked the function
fun1(ptr);
BTW the function signature is fun1(void *vptr)
In this case wont be able to re-direct the void pointer to get the
individual pointers. I tried with character pointers but they are
giving warnings.
Please explain if any method exists. Hoping for replies.
I have a query regarding the passing of pointers of different types to
a function using single parameter at same time.
Suppose i have
struct type1 abc;
struct type2 xyz;
My intention is to pass the address of the structures to a function.
I tried
- Before the invocation a void pointer array is initialised.
void *ptr[2] = {
(void *)&abc,
(void *)&xyz
}
Invoked the function
fun1(ptr);
BTW the function signature is fun1(void *vptr)
In this case wont be able to re-direct the void pointer to get the
individual pointers. I tried with character pointers but they are
giving warnings.
Please explain if any method exists. Hoping for replies.