The other case, char strg[11] = "C rules!!!"; is really where my confusion came from.
Exactly, I think your confusion comes from the fact that in a variable declaration the = has a different meaning then in a normal C statement.
In a variable declaration the = character is used to initialize the variable and this initialization allows to initialize all the single members of an array.
The = in a statement is an assignment and can only assign a value to one member of an array.
So the following statement is OK:
char test[4] = "foo";But the following is illegal :
char test[4];
test = "foo";
or
char test[4];
test[4] = "foo";
greets,
Staf.