Does c++ standard support non-const data member being as array bounds? -


see following code:

class x {     int a; public:     void foo() {         char arr[a]; // not constant variable, g++ doesn't report error, why?     } }; 

i thought constant expression can used in array bounds, until today met strange code above. both g++ , clang++ can compile successfully. can't find description in c++ standard supporting it. extented content of compiler? , can find description it?

no, c++ standard doesn't support vla


Comments

Popular posts from this blog

monitor web browser programmatically in Android? -

Shrink a YouTube video to responsive width -

wpf - PdfWriter.GetInstance throws System.NullReferenceException -