Sheesh talk about missing a big one...
Code:
int arraycpy(int *a, int *b) {
int x;
x=0;
while((a[x]=b[x])!='\0') {
x++;
}
}
Ok the problem may not be apparent but since this looks for a null terminator to a numberic array...you are lucky you aren't getting seg faults more than anything. That said you should copy the arrays like this:
Example:
Code:
int arraycpy(int *dst, int *src, size_t size) {
do {
dst++=*src++;
} while(--size);
}
I changed the names of the parameters to make things more clear. Why do this? Well it may have something to do with the fact that you were putting the random numbers int ia, but then having ib copy its values over into ia.