c++ vc2005 关于返回结构体指针的问题
头文件struct team
{
char a[5];
char b[10];
}
struct team *new_p, *p , *head;
struct team* get_head();//要在其他类中用到头指针
cpp文件
struct team* CGAme::get_head()//获取表头指针
{
return head;
}
这是编译时报的错
f:\vc_test\my_xiangmu\my_xiangmu\game.cpp(578) : error C2556: 'team *CGAme::get_head(void)' : overloaded function differs only by return type from 'CGAme::team *CGAme::get_head(void)'
f:\vc_test\my_xiangmu\my_xiangmu\game.h(64) : see declaration of 'CGAme::get_head'
f:\vc_test\my_xiangmu\my_xiangmu\game.cpp(578) : error C2371: 'CGAme::get_head' : redefinition; different basic types
f:\vc_test\my_xiangmu\my_xiangmu\game.h(64) : see declaration of 'CGAme::get_head'