Liste des Groupes | Revenir à cl c |
On Sun 2/9/2025 9:19 AM, Janis Papanagnou wrote:>
I had other languages in mind.[*]
>
Janis
>
[*] For example Simula:
>
begin
integer n;
n := inint;
begin
integer array arr (1:n);
arr(5) := 9;
end
end
>
(Which is also understandable, since in Simula declarations must appear
before statements in any block.)
Well, in that case your previous mentions of "block context" are not
related to VLAs at all. You apparently meant that in order to introduce
a new declaration, any new declaration "in the middle of the code" one
needs to open a new block - just because the language requires all
declarations to reside at the beginning of a block.
This was the case in C90, where we also sometimes had to open new blocks
to introduce new declarations. But starting from C99 this is no longer
necessary. In C99 one can simply place declarations in the middle of the
code "C++-style" (the underlying semantics is still different from C++,
but syntactically/superficially it looks pretty much the same).
Les messages affichés proviennent d'usenet.