M
Marcelo
Hello,
I have some problems with my pointers.
For exemple I have pointer as
uchar* pr;
pr = (uchar *) malloc(3 * compSize);
int i = 0;
for( i = 0 ; i< 4; i++){
uchar red = ((body >> 16) & 0xff);
*pr++ = red;
}
for( i = 4 ; i > 0; i--) {
printf("pointers: %x %x %x \n", *(pr-i));
}
As you can see my problem is that I have lost the first position of my pointer,
how can I fix this situation? Supposing that I don't want to create another pointer?
thanks
Marcelo
PS: whats the difference between
*pointer
and
pointer[value]
I have some problems with my pointers.
For exemple I have pointer as
uchar* pr;
pr = (uchar *) malloc(3 * compSize);
int i = 0;
for( i = 0 ; i< 4; i++){
uchar red = ((body >> 16) & 0xff);
*pr++ = red;
}
for( i = 4 ; i > 0; i--) {
printf("pointers: %x %x %x \n", *(pr-i));
}
As you can see my problem is that I have lost the first position of my pointer,
how can I fix this situation? Supposing that I don't want to create another pointer?
thanks
Marcelo
PS: whats the difference between
*pointer
and
pointer[value]