Logo

Programming-Idioms

History of Idiom 209 > diff from v1 to v2

Edit summary for version 2 by tkoenig:
Fix markup

Version 1

2019-09-30, 08:00:15

Version 2

2019-09-30, 08:00:56

Idiom #209 Type with automatic deep allocation

Declare a type t which contains a string s and an integer array n with variable size, and allocate a variable a of type t. Allocate v.s and v.n and set them to the values "Hello, world!" for s and [1,4,9,16,25], respectively. Deallocate v, automatically deallocating v.s and v.n (no memory leaks).

Idiom #209 Type with automatic deep allocation

Declare a type t which contains a string s and an integer array n with variable size, and allocate a variable a of type t. Allocate v.s and v.n and set them to the values "Hello, world!" for s and [1,4,9,16,25], respectively. Deallocate v, automatically deallocating v.s and v.n (no memory leaks).