Inserting into zero-length dynamic array

Cecil Ward cecil at cecilward.com
Tue Jul 4 19:19:04 UTC 2023


I have a dynamic array of strings of length zero. When i write to 
the first element the program crashes, not surprisingly, but what 
should I be doing?

  dstring[] arr;

  arr[0] = "my string"d; // BANG !!


More information about the Digitalmars-d-learn mailing list