[CSI] zero size arrays

Mikhail Nesterenko mikhail at cs.kent.edu
Mon Feb 17 11:40:15 EST 2020


CSI students,

It turns out, C++ standard explicitly prohibits arrays with zero
size. Constructs such as these are illegal:

      int myarray[0];

It is a bit strange since dynamically allocated arrays, studied in
CSIB such as these

      int *myarray = new int[0];

are allowed. They make coding somewhat simpler. More on this in CSIB.

Thanks,
-- 
Mikhail


More information about the cs13001 mailing list