小编doo*_*ogy的帖子

为什么这会说“预期”(“成本为整数?”)

例如:

struct Spell 
{
    int id;
    vector<int> cost(4);
};
Run Code Online (Sandbox Code Playgroud)

它说

'Expected parameter declaration'.
Run Code Online (Sandbox Code Playgroud)

另外这段代码有什么区别吗?

if (can(vector <int>inv, spell.cost)) 
{
    cout << "CAST " << spell.id << endl;
    done = true;
    break;
}
Run Code Online (Sandbox Code Playgroud)

这个说

'Expected '(' for function-style cast or type construction'
        
        
Run Code Online (Sandbox Code Playgroud)

有机会可以帮我一下吗?

c++ class declaration stdvector

3
推荐指数
1
解决办法
131
查看次数

标签 统计

c++ ×1

class ×1

declaration ×1

stdvector ×1