You should understand the difference between initialization and assignment. Initialization is defining a variable and assigning it a value in the same statement. The following statement defines a variable ch of type char[10] - an array of 10 characters and then assigns it with a string literal.
char ch[10] = "hello";
This is equivalent to
char ch[10] = {'h', 'e', 'l', 'l', 'o', '\0'};
Note that you assign only the first 6 elements of the array ch, the remaining 4 are implicitly initialized to the null character - '\0'. Therefore, the above two statements do the same as:
char ch[10] = {'h', 'e', 'l', 'l', 'o', '\0', '\0', '\0', '\0', '\0'};
An assignment is when you first define a variable and then assign it a value in a separate statement.
char ch[10]; // define ch of type char[10]. contains garbage right now.
You should not use ch just after defining it because it contains garbage value. Next, you should assign it a value but then you can't assign it like you did in initialization. That's not allowed by the rules of C. You can't assign all elements of the array in one go but must assign each element of the array separately.
char ch[10]; const char *s = "hello"; int len = strlen(s); for(int i = 0; i <= len; i++) // copy the null byte as well ch[i] = s[i];
Here, you have assigned only the first 6 elements of the array ch, the remaining 4 still contain garbage values unless you assign them. That's one difference here between array initialization and assignment.
lvalue?chis not alvalue. See my answer for reference