Problems with VLA in C

enter image description here

I am running Xcode 7.1 on Mac OS X 10.11. I am trying to declare a VLA array in C, but I cannot do this.

second, I use a variable in an array declaration, this is a moot point. An array is not created. I dug in the compiler settings, tried to install GCC manually, I can not figure it out. Can anyone spot the problem? From what I understand, VLA has become standard with C99, and from what I can say, my Xcode works on C11. What is the deal here? Code images and settings are included.

void printTriangle (int height, char rowPatterns[][height]) {

    int rowSize = 2 * height - 1;
    char rowString[rowSize]; //string to store in pattern array
    int characterCount = rowSize; //number of character printed per row of triangle
    int asteriskCount = 1; //number of asterisks printed in each row
    int spaces = (characterCount - asteriskCount) / 2; //how many spaces need to be printed in this current row
    int rowCount;
// rest of the code...
   }

enter image description here

enter image description here

enter image description here

+4
source share
1 answer

VLA, , , . , . VLA .

+1

Source: https://habr.com/ru/post/1612718/


All Articles