#include <stdio.h>

int main(void)
{

    double roomdata[5][18][2],t;

    scanf(" %lf",t);
    roomdata[0] = t; // How Come this does not work?
                     // I get a error "Incompatible Types in Assignment"
                     // but both roomdata array and t are same type of double.
}


我正在尝试为索引[0]处的数组roomdata分配一个值,但是每次尝试时,我都会收到一条错误消息,指出它的赋值类型不兼容,但是我都将其初始化为双精度吗?我猜想它与3d阵列有关,但我不确定。

最佳答案

它应该是

scanf(" %lf", &t);
roomdata[0][0][0] = t;

10-08 15:10