Boost logo

Boost Users :

From: Vladimir Prus (ghost_at_[hidden])
Date: 2004-11-29 10:14:33


keith.briggs_at_[hidden] wrote:

>>So, you get a code like: const int V = n; int D[V][V]; In this case, 'V'
>>is not a compile time constant and the second line >is not valid -- array
>>bounds must be compile time constant. I have no idea why you get the error
>>you get, instead of >error right at the point where array is declared.
>>Most likely, this is diagnostic problem in the rather ancient (;-))
>>version of >gcc that you're using.
> Ok, so what's the right say to do this kind of dynamically-sized problem?

   vector< vector<int> > D(V, vector<int>(V));

- Volodya


Boost-users list run by williamkempf at hotmail.com, kalb at libertysoft.com, bjorn.karlsson at readsoft.com, gregod at cs.rpi.edu, wekempf at cox.net