Hello! I'm currently doing work with arrays, and am having trouble visualizing what is happening with my code. From what I understand,
0Code:char names[100][20]; y=0; printf("Enter inventory type:"); scanf("%s", &z); names[y][y]=z; printf("[%d][%d]=%s", y, y, names[y][y]);
when fruit is is scanned in, looks like this...0 Fruits
But when I try to print out fruits again from the array, I encounter a problem and the program is forced to close. Can someone please explain to me where I am going wrong?
thanks,
Alex