The correct output is Visual C++. You can't allocate an array with an unconstant variable, the way to do that is with dynamic allocation (new, malloc,...).

Hardy Huang escribió:

Hi,
The following code produced different output from two different
compiler which is Dev C++ and Visual C++ 2005.

int n;
cin >> n;
list<int> myList[n];

Dev C++ compiled with no problem but visual C++ 2005 failed to compile
with error with the following error messages:
error C2057: expected constant _expression_
error C2466: cannot allocate an array of constant size 0
error C2133: 'myList' : unknown size

Which one is the true output?
Thx in advance

__._,_.___

To unsubscribe, send a blank message to <mailto:[EMAIL PROTECTED]>.




SPONSORED LINKS
C programming language Programming languages Computer programming languages
Java programming language


YAHOO! GROUPS LINKS




__,_._,___

Reply via email to