gpt4 book ai didi

c++ - 使用 GCC 编译时 C++ 中的未知结构错误

转载 作者:行者123 更新时间:2023-11-27 22:43:03 25 4
gpt4 key购买 nike

<分区>

#include <iostream>
#include <stdio.h>
#include <vector>
using namespace std;

int Answer;
struct _pair {
struct _pair(int a) : value(a), cnt(1) {}
unsigned int value;
unsigned int cnt;
};


int main(int argc, char** argv)
{

return 0;
}

此代码出现错误:“错误:在‘int’之前需要不合格的 id结构_pair(int a):值(a),cnt(1){}“

在VS2017上不报错,在GCC编译器上报错。

25 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com