S
s88
Howdy:
the follows is my program, I wanna change my structure array
pointer in the function "testfunc", but I fail..., I also try to call
the testfunc by reference, but the compiler says "test6.c:35: error:
incompatible type for argument 1 of `testfunc'". Can I make my purpose
in C?
and how?
typedef struct xxxx *xxxx_ptr;
typedef struct xxxx{
int just;
long for_the;
char *test;
}xxxx;
void testfunc(xxxx_ptr ptr){
ptr++;
}
int main(void){
xxxx XXXX[10];
xxxx_ptr ptr = &XXXX[0];
printf("%x\n",ptr);
testfunc(ptr);
printf("%x\n",ptr);
return 0;
}
Thank you all.
Dave.
the follows is my program, I wanna change my structure array
pointer in the function "testfunc", but I fail..., I also try to call
the testfunc by reference, but the compiler says "test6.c:35: error:
incompatible type for argument 1 of `testfunc'". Can I make my purpose
in C?
and how?
typedef struct xxxx *xxxx_ptr;
typedef struct xxxx{
int just;
long for_the;
char *test;
}xxxx;
void testfunc(xxxx_ptr ptr){
ptr++;
}
int main(void){
xxxx XXXX[10];
xxxx_ptr ptr = &XXXX[0];
printf("%x\n",ptr);
testfunc(ptr);
printf("%x\n",ptr);
return 0;
}
Thank you all.
Dave.