Re: Variable array bound

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



I faced the same dilemma sometimes back.

check out this link.

http://www.devx.com/cplus/10MinuteSolution/27219/0/page/3

Stuart Brooks wrote:

Hi,

I was surprised to find that the following code compiles (and runs)
successfully under gcc 4.0.2 (and 3.3.3) :

void SomeFunc(int array_size)
{
 int arr[array_size];
 // use array ...
}

Should this compile? My version of Stroustrup's 'The C++ Programming
Language (c) 2000' states in section 5.2: "The number of elements of the
array, the array bound, must be a constant expression".

Is this by any chance a gcc extension?

Regards
Stuart




--
If you are good, you will be assigned all the work.  If you are real good, you will get out of it




[Index of Archives]     [Linux C Programming]     [Linux Kernel]     [eCos]     [Fedora Development]     [Fedora Announce]     [Autoconf]     [The DWARVES Debugging Tools]     [Yosemite Campsites]     [Yosemite News]     [Linux GCC]

  Powered by Linux