[prog] Definining an array in Visual C++

Terri Oda terri at zone12.com
Tue Mar 25 19:36:11 EST 2003


> creating automatic arrays that vary in size at runtime (i.e the size is
> not known at compile time) is a gcc extension I believe. At least none of
> the other compilers I use (HP, SUN, DEC, AIX, VC++) accept it.

That's the answer I was hoping I *wouldn't* get.  I'm obviously becoming
soft now that it's been a few years since I had to support more than one
platform at a time. :)
 
> Alternatively, perhaps it may be a good opportunity to become familiar
> with the standard library and use a std::vector?

I've been debating whether I want to make it a vector, since I'm reasonably
familiar with the vector class, if not the rest of the standard template
library (It's on the list of things to learn all the time, but my past few
jobs have been using lightweight libraries or other languages.)  But isn't a
vector somewhat overkill, since I know the size at allocation-time and it
doesn't change, even if I don't know it at compile time?  Would a list be
better?

 Terri


More information about the Programming mailing list