That doesn't make any sense.
sidoh@deepthought:~/public_html/src$ cat test.c; gcc test.c -o test; ./test
#include <stdio.h>
void swap();
int main( int argc, char *argv[] ) {
int array1[3] = {1, 2 ,3};
int array2[3] = {3, 2, 1};
printf("\n\n");
printf("Array 1, node 0 has a value of %d.\nArray 2, node 0 has a value of %d.", array1[0], array2[0]);
//swap(&array1[0], &array2[0]);
int temp = array1[0];
array1[0] = array2[0];
array2[0] = temp;
printf("\n\n");
printf("Array 1, node 0 has a value of %d.\nArray 2, node 0 has a value of %d.", array1[0], array2[0]);
swap(&array1[0], &array2[0]);
printf("\n\n");
printf("Array 1, node 0 has a value of %d.\nArray 2, node 0 has a value of %d.", array1[0], array2[0]);
printf("\n\n");
return 0;
}
void swap(int **value1, int **value2)
{
int temp = (int)*value2;
*value2 = *value1;
*value1 = temp;
return;
}
test.c: In function `swap':
test.c:37: warning: assignment makes pointer from integer without a cast
Array 1, node 0 has a value of 1.
Array 2, node 0 has a value of 3.
Array 1, node 0 has a value of 3.
Array 2, node 0 has a value of 1.
Array 1, node 0 has a value of 1.
Array 2, node 0 has a value of 3.
PM me your code and I'll try to take a look at it.