When I run this code:
#include <stdio.h>
int main() {
int x[10] = {1, 2, 3, 4, 5, 6, 7, 8, 9, 10};
int y[10] = {2, 4, 6, 8, 10, 12, 14, 16, 18, 20};
int t;
for (t = 0 ; t < 22 ;t++){
printf( "%d\t\n", x[t]);
}
return 0;
}
for some reason, C is concatenating the y array onto the x array. Could somebody please explain why it is doing that? Thanks.