Is this a correct ?
This is compiled with g++ (3.4) sucessfully.
Code:int main()
{
int x = 12;
char pz[x];
}
Printable View
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.Quote:
Originally Posted by janaka
And if your intention was to write C99 code then it is valid. Otherwise use std::vector<char>.