Q:

How to copy item of char of array at specific index to anther array in C

Suppose there are two arrays e.g
char arr1[10]="12345";
char arr2[4][4]={"0","-1"};

I want to copy item at index 1 in arr1 into arr2 at index 1. How can i do this ?  I have tried this
strcpy(arr2[1],arr1[1])

But i am not able to copy.

A:

copy the character
add the terminating null character

code:
char arr1[10]="12345";
char arr2[4][4]={"0","-1"};

arr2[1][0] = arr1[1]; /* 1 */
arr2[1][1] = '\0'; /* 2 */

