> Variable-length array is a new feature in C99, which is not used much **and 
> is not available in C++**.

Come again? This compiles _and runs_ just fine in `clang++`. I mean, just fine 
for a C++ program.
    
    
    // usage: <filename> <n> <el_1> <el_2> ... <el_n>
    // example: ./a.out 5 8 4 3 1 6
    // has output 8 4 3 1 6
    #include <iostream>
    
    int main(int argc, char * argv[]) {
      
      int n = argv[1][0] - '0';
      int a[n];
      
      for (int i = 2; i < n + 2; ++i)
        a[i - 2] = argv[i][0] - '0';
      
      for (int i = 0; i < n; ++i)
        std::cout << a[i] << ' ';
      
      std::cout << std::endl;
    
    }
    
    
    Run

Reply via email to