C2 forum

General Category => General Discussion => Topic started by: gerard on December 29, 2016, 07:07:33 PM

Title: Question: how are growable arrays implemented?
Post by: gerard on December 29, 2016, 07:07:33 PM
Just curious...
Title: Re: Question: how are growable arrays implemented?
Post by: bas on January 02, 2017, 03:44:32 PM
C2 doesn't have growable arrays in the sense that they can grow during runtime. They can 'grow' during compilation. The C2 compiler just
merges all the 'array += value' declarations and creates a single (static) array. The may goal was to avoid having to use complicated macros when
you want to extend both an enum and a  data structure that uses the enum constants as index.