NGWS SDK Documentation  

This is preliminary documentation and subject to change.
To comment on this topic, please send us email at ngwssdk@microsoft.com. Thanks!

Compiler Error C2452

array bound expression of type 'type' is illegal

An array is declared with a bound expression that cannot be converted to type int.

Example

class C { int a; } aC;
class D { public: int a; operator int() { return a; } } aD;
class E { public: double a; operator double() { return a; } } aE;
int (*pf)();

void func()
{
   char *buf;
   int *pi;  
   
   buf = new char[aC];  // error, no conversion from C to int
   buf = new char[pi];  // error, int * is illegal type for array bound
   buf = new char[pf];  // error, int (*)() is illegal for array bound
   buf = new char[10L]; // OK
   buf = new char[aD];  // OK, conversion by D::operator int()
   buf = new char[aE];  // OK, conversion by E::operator double()
}