回 帖 发 新 帖 刷新版面

主题:[讨论]高手进来帮忙解决下问题呀   万分感谢

struct Workstations
{
    double MTBF;                      
    double MTTR;                     
    double MTTRbzc;                   
    double availability;              
           double naturalprocesstime;        
    double naturalbzc;                
    double effectiveprocesstime;      
    double effectivebzc;              
    double processCV;                 
    double setuptime;                 
 
    double setupbzc;                  
    int Ns;                           
    int machinenum;                   
    double utilization;               
    int number;                       
    double Ra;                        
    double arrivalCV;                 
    double CTq;                       
    
}w[3]={{12,4,4,0,0.06,0.003,0,0,0,2,0.5,200,4,0,0,0,0,0},{2,0.6,0.6,0,0.04,0.002,0,0,0,1.5,0.35,300,3,0,1,0,0,0},
{2.5,0.8,0.8,0,0.02,0.001,0,0,0,1.2,0.3,600,2,0,2,0,0,0}};

struct Layers
{
    int number;                                 
    int wnum;                                   
    struct Workstations workstation[1000];      
    double aCV;                                 
    double RB;                                  
};

struct Wafers
{
    int number;                                 
    int layernum;                               
    double arrivaltime;                         
    double arrivalbzc;                          
    struct Layers layer[50];                    
    double D;                                   
    double BB;                                  
};

错误在以下部分

[color=008000][size=3]struct Wafers wafer[2];
struct Wafers wafer[0].number=1;
struct Wafers wafer[0].layernum=2;
struct Wafers wafer[0].arrivaltime=0.067;
struct Wafers wafer[0].arrivalbzc=0.04;
struct Wafers wafer[0].layer[0].number=1;
struct Wafers wafer[0].layer[0].wnum=3;
struct Wafers wafer[0].layer[0].aCV=0;
struct Wafers wafer[0].layer[0].RB=0;
struct Wafers wafer[0].layer[0].workstation[0].number=2;
struct Wafers wafer[0].layer[0].workstation[1].number=1;
struct Wafers wafer[0].layer[0].workstation[2].number=0;
struct Wafers wafer[0].layer[1].number=2;
struct Wafers wafer[0].layer[1].wnum=2;
struct Wafers wafer[0].layer[1].aCV=0;
struct Wafers wafer[0].layer[1].RB=0;
struct Wafers wafer[0].layer[1].workstation[0].number=1;
struct Wafers wafer[0].layer[1].workstation[1].number=0;
struct Wafers wafer[0].D=0.7;
struct Wafers wafer[0].BB=0;

struct Wafers wafer[1].number=2;
struct Wafers wafer[1].layernum=3;
struct Wafers wafer[1].arrivaltime=0.05;
struct Wafers wafer[1].arrivalbzc=0.07;
struct Wafers wafer[1].layer[0].number=1;
struct Wafers wafer[1].layer[0].wnum=2;
struct Wafers wafer[1].layer[0].aCV=0;
struct Wafers wafer[1].layer[0].RB=0;
struct Wafers wafer[1].layer[0].workstation[0].number=2;
struct Wafers wafer[1].layer[0].workstation[1].number=0;
struct Wafers wafer[1].layer[1].number=2;
struct Wafers wafer[1].layer[1].wnum=2;
struct Wafers wafer[1].layer[1].aCV=0;
struct Wafers wafer[1].layer[1].RB=0;
struct Wafers wafer[1].layer[1].workstation[0].number=1;
struct Wafers wafer[1].layer[1].workstation[1].number=0;
struct Wafers wafer[1].layer[2].number=3;
struct Wafers wafer[1].layer[2].wnum=3;
struct Wafers wafer[1].layer[2].aCV=0;
struct Wafers wafer[1].layer[2].RB=0;
struct Wafers wafer[1].layer[2].workstation[0].number=1;
struct Wafers wafer[1].layer[2].workstation[1].number=2;
struct Wafers wafer[1].layer[2].workstation[2].number=0;
struct Wafers wafer[1].D=0.3;
struct Wafers wafer[1].BB=0[/size];

以下是错误类型,大家帮忙看下是哪里错了   万分感谢啦!!!!!!

error C2466: cannot allocate an array of constant size 0
error C2143: syntax error : missing ';' before '.'
error C2369: 'wafer' : redefinition; different subscripts
see declaration of 'wafer'
fatal error C1003: error count exceeds 100; stopping compilation

回复列表 (共2个回复)

沙发

没有问题阿

板凳

struct Wafers wafer[2];
后面的wafer前不需要在加struct Wafers了,struct Wafers是定义用的,

我来回复

您尚未登录,请登录后再回复。点此登录或注册