What is the difference between:
char fast_car[15]="Bugatti";
and
char fast_car[15];
fast_car="Bugatti";
Because the second one results with compile error:
error: incompatible types when assigning to type ‘char[15]’ from type
‘char *’
While the first one works fine. Putting a string in array in different place than array initialisation would be helpful.
The first is an initialization while the second is an assignment. Since arrays aren’t modifiable values in C you can’t assign new values to them.
Mind you, you can modify array contents, you just can’t say
fast_car = .... So the contents are modifiable, the arrays themselves are not.Using the same symbol
=for these widely different concepts is of debatable value.