title: Array with size 0
body: <p>Today I incidentally defined a two dimensional array with the size of one dimension being 0, however my compiler did not complain. I found the following which states that this is legal, at least in the case of gcc:</p>
  
  <p><a href="http://gcc.gnu.org/onlinedocs/gcc/Zero-Length.html" rel="noreferrer">6.17 Arrays of Length Zero</a></p>
  
  <p>However, I have two questions on this usage:</p>
  
  <p>First, is this considered as good programming practice? If so, then when should we use it in real world?</p>
  
  <p>Second, the array I defined was two dimensional, with 0 size for one dimension. Is this the same as the one dimensional case? For example,</p>
  
  <pre><code>int s[0]
  int s[0][100]
  int s[100][0]
  </code></pre>
  
  <p>Are they all the same in the memory and for the compiler?</p>
  
  <p>EDIT: Reply to Greg: The compiler I am using is gcc 4.4.5. My intention for this problem is not compiler-dependent, however if there are any compiler specific quirks that would be helpful too:)</p>
  
  <p>Thanks in advance!</p>