Hacker News new | past | comments | ask | show | jobs | submit login

I usually don't let them leak into public interfaces, and don't allocate VLAs, but really like VLA pointers for multi-dimensional array processing such as []:

  double (*a)[N][P] = (double (*)[N][P])a_flat;
  for (i=0; i<M; i++)
    for (j=0; j<N; j++)
      for (k=0; k<P; k++)
        a[i][j][k] = f(i, j, k);
The alternative would be

        a_flat[(i*M+j)*P+k] = f(i, j, k);
which is a lot more error-prone. I understand that some implementation (MSVC) declined to implement VLAs, but I really wish that at least VLA-pointers could have remained a mandatory part of C11 and later standards.

[] Has there been any discussion of adding GCC's "typeof" to the standard?




Guidelines | FAQ | Lists | API | Security | Legal | Apply to YC | Contact

Search: