Wednesday, May 13, 2009

Cool pointer

Have you try a code like this?

int main (void)
{
  int date[12][31];
  int (*m)[31];
  int *d;

  for (m = date; m < &date[12]; m++)
    {
      **m = 0;
      for (d = *m; d < &(*m)[31]; d++)
        *d = 0;
    }
  return 0;
}