"Pascal Obry" wrote in message news:482E8A9D.5040401@obry.net... > jhc0033@gmail.com a �crit : >> Did I misunderstand? > > You have already received a bunch of excellent answers. I'd like to point > out that in Ada you have less need for dynamically allocated memory. Ada > supports unconstraint types. Objects of such types when declared can be > "allocated" on the stack and passed around (no heap usage). A simple > example: > > type Vector is (Positive range <>) of Float; > > function Norm (V : in Vector) return Float; > > ... > > declare > V : Vector (1 .. 100); > R : Float; > begin > R := Norm (V); > ... > > Not a single memory allocation. In C/C++ you'll need to dynamically > allocate V on the heap, and then worry about freeing this memory. > > Pascal. Actually, the same construct exists in c/c++. Stack frame allocation only needs a block to allow object definitions (c++ does it almost anywhere). To whit: #include int main(void) { int x = 3; int y = 7; int z = 2; printf("x, y, z: %0d, %0d, %0d\n", x, y, z); { int w = 9; printf("x, y, z, w: %0d, %0d, %0d, %0d\n", x, y, z, w); } } x, y, z: 3, 7, 2 x, y, z, w: 3, 7, 2, 9