VS2022编译错误:编译器错误 C2061

您所在的位置:网站首页 c206报错 VS2022编译错误:编译器错误 C2061

VS2022编译错误:编译器错误 C2061

2024-05-06 23:25| 来源: 网络整理| 查看: 265

产生原因

  自己在做课后练习时,讲char类型替换为了string类型,编译器报错了很多错误,具体的代码如下:

golf.h #pragma once #include //原本没有这两句会出错 using namespace std;//原本没有这两句会出错 struct gof { string fullname; int handicap; }; inline void set_golf(gof& g,string name, int hc); inline int set_golf(gof& g); inline void hanicap(gof& g, int hc); inline void show_golf(const gof& g); golf_fun.cpp #include //#include #include "golf.h" using namespace std; //指定设置 void set_golf(gof& g, const string name, int hc) { g.fullname = name; g.handicap = hc; } //输入设置 int set_golf(gof& g) { int temp = 1; cout g.handicap; cin.get(); return temp; } } //handicap设置 void hanicap(gof& g,int hc) { g.handicap = hc; } //golf结构体打印 void show_golf(const gof& g) { cout


【本文地址】


今日新闻


推荐新闻


CopyRight 2018-2019 办公设备维修网 版权所有 豫ICP备15022753号-3