Is this a correct ?
This is compiled with g++ (3.4) sucessfully.
Code:int main() { int x = 12; char pz[x]; }
Is this a correct ?
This is compiled with g++ (3.4) sucessfully.
Code:int main() { int x = 12; char pz[x]; }
If your aim is to write standard C++, then no, that is not correct. If your aim is to use g++'s variable length array compiler extension for g++, then yes, that is correct.Originally Posted by janaka
Look up a C++ Reference and learn How To Ask Questions The Smart WayOriginally Posted by Bjarne Stroustrup (2000-10-14)
And if your intention was to write C99 code then it is valid. Otherwise use std::vector<char>.