S
sinbad
is there anything wrong with the following program. specifically
i am asking about casting pointer to an integer pointer (double
pointer)
to a void pointer and casting it back to double pointer.
1 void func(void *x)
2 {
3 int *y;
4 y = (*(int **)x);
5 y++;
6 *((int**)x) = y;
7
8 return;
9 }
10
11 int main(void)
12 {
13 int z = 10;
14 int *y = &z;
15
16 func(&y);
17
18 return 0;
19 }
~
i am asking about casting pointer to an integer pointer (double
pointer)
to a void pointer and casting it back to double pointer.
1 void func(void *x)
2 {
3 int *y;
4 y = (*(int **)x);
5 y++;
6 *((int**)x) = y;
7
8 return;
9 }
10
11 int main(void)
12 {
13 int z = 10;
14 int *y = &z;
15
16 func(&y);
17
18 return 0;
19 }
~