In the _c++ primer_ dynamic array, it is legal to allocate an empty array dynamically.
size_t n = get_size();int* p = new int[n];for(int* q = p; q != p + n; ++q)char arr[0];//错误char cp = new char[0];
When we use new to allocate an array of size 0, new returns a valid non-null pointer. This pointer is guaranteed to be different from any other pointers returned by new, and for arrays of length 0, this pointer is like a trailing pointer. We can use this pointer like a post-tail iterator.
Chenhao Blog C language structure in the member array and pointers, refers to the 0-length array meaning.
A 0-long array at the end of a structure, such as a char bytes[0], that indicates that the structure is indefinite and can be extended by means of an array. The structure must contain a length information. The structure itself resembles an information header. At the same time, this structure can only allocate memory by heap.
Reference
[1].http://blog.csdn.net/wade23/article/details/4510971
[2].http://coolshell.cn/articles/11377.html
0 length array meaning