JJYY151456 2015-08-13 03:01 采纳率: 0%
浏览 2532

新人求问:程序提示无法解析的外部符号,无法解析的外部命令

源代码如下
此处为头文件golf.h
//headfile golf
#ifndef golf
const int len=40;
struct golf
{
char fullname[len];
int handicap;
};
void setgolf(golf & g,char *name,int hc);
int setgolf(golf & g);
void handicap(golf & g,int hc);
void showgolf(const golf &g);
#endif

函数的声明 fu.cpp
//declare the functions
#include
#include
#include"golf.h"
void setgolf(golf & g,const char *name,int hc)
{
name=g.fullname;
g.handicap=hc;
}
int setgolf(golf & g)
{
std::cin>>g.fullname;
std::cin>>g.handicap;
std::string c;
c=g.fullname;
if(c.empty())
return 0;
else
return 1;

}
void handicap(golf & g,int hc)
{
g.handicap=hc;
}
void showgolf(const golf &g)
{
std::cout< }
//主函数部分:gl.cpp
#include
#include"golf.h"
int main()
{
golf ann[2];
setgolf(ann[0],"dazhoang",14);
int go=setgolf(ann[1]);
handicap(ann[0],14);
std::cout<<go;
showgolf(ann[0]);
std::cout<<std::endl;
showgolf(ann[1]);
system("pause");
return 0;
}

  • 写回答

5条回答

  • 纵横车 2015-08-13 03:21
    关注

    哪个命令无法解析?

     void showgolf(const golf &g)
    {
    std::cout< }
    

    这是什么?没复制全?

    评论

报告相同问题?

悬赏问题

  • ¥15 执行 virtuoso 命令后,界面没有,cadence 启动不起来
  • ¥50 comfyui下连接animatediff节点生成视频质量非常差的原因
  • ¥20 有关区间dp的问题求解
  • ¥15 多电路系统共用电源的串扰问题
  • ¥15 slam rangenet++配置
  • ¥15 有没有研究水声通信方面的帮我改俩matlab代码
  • ¥15 ubuntu子系统密码忘记
  • ¥15 保护模式-系统加载-段寄存器
  • ¥15 电脑桌面设定一个区域禁止鼠标操作
  • ¥15 求NPF226060磁芯的详细资料