当前位置: 技术问答>linux和unix
编译又出错了
来源: 互联网 发布时间:2015-06-13
本文导语: [root@localhost c]# cat mysql.c #include #include #include main() { char *home_name="aaa"; char *away_name="bbb"; char home_sn[10]; char away_sn[10]; char check_team(char *team_name); ...
[root@localhost c]# cat mysql.c
#include
#include
#include
main()
{
char *home_name="aaa";
char *away_name="bbb";
char home_sn[10];
char away_sn[10];
char check_team(char *team_name);
home_sn = check_team(*home_name);
away_sn = check_team(*away_name);
printf("%st%sn",home_sn,away_sn);
}
char check_team(char *team_name)
{
printf("yes");
return *team_name;
}
出错严重信息如下,帮忙看看,谢谢
[root@localhost c]# gcc mysql.c
mysql.c: In function `main':
mysql.c:21: warning: passing arg 1 of `check_team' makes pointer from integer without a cast
mysql.c:21: error: incompatible types in assignment
mysql.c:22: warning: passing arg 1 of `check_team' makes pointer from integer without a cast
mysql.c:22: error: incompatible types in assignment
#include
#include
#include
main()
{
char *home_name="aaa";
char *away_name="bbb";
char home_sn[10];
char away_sn[10];
char check_team(char *team_name);
home_sn = check_team(*home_name);
away_sn = check_team(*away_name);
printf("%st%sn",home_sn,away_sn);
}
char check_team(char *team_name)
{
printf("yes");
return *team_name;
}
出错严重信息如下,帮忙看看,谢谢
[root@localhost c]# gcc mysql.c
mysql.c: In function `main':
mysql.c:21: warning: passing arg 1 of `check_team' makes pointer from integer without a cast
mysql.c:21: error: incompatible types in assignment
mysql.c:22: warning: passing arg 1 of `check_team' makes pointer from integer without a cast
mysql.c:22: error: incompatible types in assignment
|
??????
狂晕
char away_sn[10];
away_sn = check_team(*away_name);
char * check_team(char *team_name)
{
printf("yes");
return *team_name;
}
狂晕
char away_sn[10];
away_sn = check_team(*away_name);
char * check_team(char *team_name)
{
printf("yes");
return *team_name;
}
|
怎么copy的他的 firstyi(firstyi)
char check_team(char *team_name)
{
printf("yes");
return *team_name;
}
这两个地方都多少有问题
char check_team(char *team_name)
{
printf("yes");
return *team_name;
}
这两个地方都多少有问题