Flash Gordon wrote:
lovecreatesbeauty wrote:
In the earlier days, perhaps before C99, a local array could not be
initialized unless it was declared as a static one.
In C89 you could initialise a local array. I don't know about pre-ANSI
C, but that really was a long time ago.
Yes, perhaps C89 already does it. In H&S5 sec4.6.4, it says that
(translated from Chinese edition) static arrays and external arrays can
be initialized in this way... Automatic arrays are allowed to be
initialized in Standard C [1], but the original C definition [2] did
not support this feature.
In Stephen Prata's C Primer Plus sec10.1.1, the author mentions the
similar thing also.
P.S. Hi Richard, why are you always in high dudgeon on c.l.c? Are you
the same in your real life? Could you clarify following doubts for me,
for I'm not an expert and do not have an English H&S5?
[1] I do not know what does "Standard C" mean in the Chinese edition of
the book, but I guess it means C89 now.
[2] pre-Ansi, K&R C or Classical C. The Chinese book does not state it
clear enough.