int main() { int i = 16; char* heap_area = new char [i](); }
Is line 5 valid C++ with the parens? I've never see new called this way, but it compiled fine with g++ 2.95.3. If the parens are valid, what do they mean?
With g++ 3.2.3 I get the following error:
z.cc: In function `int main()': z.cc:5: variable-sized object of type `char[i]' may not be initialized
With 3.3 the code compiles fine when the parens are removed from line 5 or if a literal constant is used in place of 'i'.
-- Paul M. Dubuc