Question: why cant I pass one arrays values to another with the program listed below: #include int array_a[10]; int array_b[10]; char temp[100]; int i = 0;

why cant I pass one arrays values to another with the program listed below:

#include  int array_a[10]; int array_b[10]; char temp[100]; int i = 0; int n = 0; int j = 0; int last; int final_array[25]; int main() { printf(" Enter up to 10 numbers for array A: "); gets(temp); while(temp[i] != '\0') { if(temp[i] != ' ') { array_a[n] = (int)(temp[i])-'0'; n++; } i++; } for(j = 0; j < n; j++) { final_array[n] = array_a[n]; } for(i = 0; i < 10; i++) { printf("%d", final_array[i]); } return 0; }

Step by Step Solution

There are 3 Steps involved in it

1 Expert Approved Answer
Step: 1 Unlock blur-text-image
Question Has Been Solved by an Expert!

Get step-by-step solutions from verified subject matter experts

Step: 2 Unlock
Step: 3 Unlock

Students Have Also Explored These Related Databases Questions!