double PP1[8][8];
double PP2[8][8];

double x;
double n;
double d;
for(double i = 0; i < 8; i++)
{
n = i + 1;
d = n / (n * (n - 1) - (n - 2) * (n - 3) / 2);
x = (n - 1) * d;
for(double k = 0; k < i ; k++)
{
PP1[i][k] = x - k * d;
}
PP1[i][i] = x;
}
有六个错误:
e:\documents and settings\administrator\my documents\map\main.cpp(77) : error C2108: subscript is not of integral type
e:\documents and settings\administrator\my documents\map\main.cpp(77) : error C2108: subscript is not of integral type
e:\documents and settings\administrator\my documents\map\main.cpp(77) : error C2440: '=' : cannot convert from 'double' to 'double (*)[8]'
        There is no context in which this conversion is possible
e:\documents and settings\administrator\my documents\map\main.cpp(79) : error C2108: subscript is not of integral type
e:\documents and settings\administrator\my documents\map\main.cpp(79) : error C2108: subscript is not of integral type
e:\documents and settings\administrator\my documents\map\main.cpp(79) : error C2440: '=' : cannot convert from 'double' to 'double (*)[8]'
        There is no context in which this conversion is possible
怎么回事啊?

解决方案 »

  1.   

    指明了是77、79行的错误,自己找吧Compiler Error C2108
    subscript is not of integral type
    A nonintegral expression was used in an array subscript
    Compiler Error C2440
    'conversion' : cannot convert from 'type1' to 'type2'The compiler was unable to cast from ‘type1’ to ‘type2.’ If you’ve encountered this error on code which compiled with an earlier version of Visual C++, please read Technote: Improved Conformance to ANSI C++ for more information.The following example illustrates this error.void main()
    {   
       int *i;
       float j;
       
       j = (float)i; /* cannot cast from
                  pointer to int to float */
    }
      

  2.   

    在CSDN论坛上搜索“提问”,如果你视力没到1000的话