RE: [GD-General] not sure where to post this question... bit C++ implementation specific....
Brought to you by:
vexxed72
From: Andras B. <bn...@ma...> - 2004-07-07 15:40:48
|
> How would that help? In C++ you simply cannot do this: > > int a = 6; > int array[a]; > > It is not possible to allocate arrays with variables (const or not const). I dunno, this compiles fine on MSVC++: const int a = 6; int array[a]; This also works fine: const int a = static_cast<const int>(5.4f / 3.6f); int array[a]; But then why it's not possible to do: const float a = 14.5f; const float b = 2.3f; const int c = static_cast<const int>(a / b); int array[c]; ? Andras |