错误增加循环

时间:2016-12-05 11:02:47

标签: c++

我在这里有一个问题,即循环正在递增currentList,我无法解决问题所在。我不知道如果我遗失了什么或者我应该清理并重建?

int currentList = 0;
bool gatesBool[2][7];
bool currentGateList[];

EV << "CurrentList 1 is " << currentList << endl;

for (int x=0; x!=7; x++)
{

    EV << "CurrentList 2 is " << currentList << endl;

    if ( gatesBool[currentList][x] == true)
    {
        currentGateList[x] = true; 
        EV << "CurrentList 3 is " << currentList << endl;
    }
    else
    {
        currentGateList[x] = false; 
        EV << "CurrentList 3 is " << currentList << endl;
    }
};
  

CurrentList 1为0
  CurrentList 2是0
  CurrentList 3是1   CurrentList 2是1   CurrentList 3是1   CurrentList 2是1   CurrentList 3是1   CurrentList 2是1   CurrentList 3是1   CurrentList 2是1   CurrentList 3是1   CurrentList 2是1   CurrentList 3是1   CurrentList 2是1   CurrentList 3是1

0 个答案:

没有答案