Using the [ ] operator to implement dynamic arrays