Warning: file_get_contents(/data/phpspider/zhask/data//catemap/6/cplusplus/134.json): failed to open stream: No such file or directory in /data/phpspider/zhask/libs/function.php on line 167

Warning: Invalid argument supplied for foreach() in /data/phpspider/zhask/libs/tag.function.php on line 1116

Notice: Undefined index: in /data/phpspider/zhask/libs/function.php on line 180

Warning: array_chunk() expects parameter 1 to be array, null given in /data/phpspider/zhask/libs/function.php on line 181
C++ 错误C2059:语法错误:'}'_C++_Syntax Error - Fatal编程技术网

C++ 错误C2059:语法错误:'}'

C++ 错误C2059:语法错误:'}',c++,syntax-error,C++,Syntax Error,我正在写一个21点程序。我创建了一张包含两个字符串和一个整数的卡片“dealer”是“card”类的向量,“dtotal”和“deckplace”都是整数“显示”是打印卡片、套装和总数的功能。如果总计>16,则错误出现在else上方的行中 void dealerTurn() { if (dtotal<17) { do while (dtotal<17) { dealer.pop_back(deck[deckpla

我正在写一个21点程序。我创建了一张包含两个字符串和一个整数的卡片“dealer”是“card”类的向量,“dtotal”和“deckplace”都是整数“显示”是打印卡片、套装和总数的功能。如果总计>16,则错误出现在else上方的行中

void dealerTurn()
{
    if (dtotal<17)
    {
        do while (dtotal<17)
        {
            dealer.pop_back(deck[deckplace]);
            deckplace = deckplace+1;

            for (y=0;y<dealer.size();y++)
            {
                if (dealer[y].name=="A" && dtotal>21)
                {
                    dealer[y].value = 1;
                    dtotal = 0;
                    for (z=0;z<dealer.size();z++)
                        dtotal = dtotal + dealer[z].value;
                }
            }

            display();

            if (dtotal>21)
            {
                cout << endl << "-----DEALER BUSTED!-----" << endl << endl;
                dtotal = 0;
            }
        }
    }
    else if (total>16)
    {
        display();
    }
    result();
}

世上没有“边做边做”的事。它是while{uuuu条件{{uuuu语句}或do{uuu语句{uuuu}while{uuu条件}