#include #include // Copy the elements of one array into another using pointers int main() { int *ip1, *ip2; int i; int a[5] = {1, 3, 4, 5, 6}; int b[5]; // not assigned yet // for(i=0; i<5; i++) // This is how we can do it without pointers // b[i] = a[i]; ip1 = &a[0]; // initialize the first pointer ip2 = &b[0]; // initialize the second pointer for(i=0; i<5; i++) // copy the array *(ip2+i) = *(ip1+i); for(i=0; i<5; i++) // print the copy printf("%d, ", *(ip2+i) /*b[i]*/); system("pause"); }