In K&R C(2nd) 127p,
The main change made by the ANSI standard is to define structure assignment-structures may be copied and assigned to, passed to functions, and returned by functions. This has been supported by most compilers for many years, but the properties are now precisely defined. Automatic structures and arrays may now also be initialized.
What's the meaning of 'Automatic structures and arrays may now also be initialized.'? I read this.
And It's written at 261p(the part of appendix C. summary of changes)
Automatic structures, unions, and arrays may be initialized, albeit in a restricted way.
I got following code is not allowed in K&R C(1st).
int main()
{
int a[3] = { 1, 2, 3 };
struct { int a; char b; } x = { 1, 2 };
}
Could you explain then how were arrays and structures initialized in that time?
It's a bit confusing where to focus, 'automatic' to 'global' or 'now be initialized' to 'couldn't be initialized'.