Hi all,
Just a simple question. How do i reverse a pointer to a set of values given that i know the size of the pointer?
Eg
int *temp = malloc(ptr_size);
// values of *ptr let say is 1......100,
// if i use the algorithm below, it gets me 1..50...1 and not 100...1
ptr_size2 = ptr_size;
temp = ptr;
for (i=0;i<ptr_size;i++) {
temp=ptr[ptr_size2--];
}
I also tried using temp[ptr_size] but still gives me the same result
Any idea?