Author Topic: Question: how are growable arrays implemented?  (Read 1229 times)

gerard

  • Newbie
  • *
  • Posts: 2
    • View Profile
Question: how are growable arrays implemented?
« on: December 29, 2016, 07:07:33 PM »
Just curious...

bas

  • Full Member
  • ***
  • Posts: 106
    • View Profile
Re: Question: how are growable arrays implemented?
« Reply #1 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.