哪的错误

[复制链接]
查看11 | 回复4 | 2021-1-27 06:45:35 | 显示全部楼层 |阅读模式
#include
#include

voidpt(charPt_Text);
intmain(){
}
pt("asd");
return(0);
}
voidpt(charPt_Text){
chara[]="Tyon->:";
printf("%s/n",strcpy(a,Pt_Text));
}
分 -->
回复

使用道具 举报

千问 | 2021-1-27 06:45:35 | 显示全部楼层
"asd"这个是字符串,你的qt()函数里传递的确实char,另外换行是\n吧


回复

使用道具 举报

千问 | 2021-1-27 06:45:35 | 显示全部楼层

#include
#include

voidpt(char*Pt_Text);
intmain(){
pt("asd");
return(0);
}
voidpt(char*Pt_Text){
chara[]="Tyon->:";
printf("%s\n",strcpy(a,Pt_Text));
}
试试.
回复

使用道具 举报

千问 | 2021-1-27 06:45:35 | 显示全部楼层
char只是一个字符,如果要表示字符串,可以用char*
回复

使用道具 举报

千问 | 2021-1-27 06:45:35 | 显示全部楼层
引用2楼github_27756899的回复:
#include
#include

voidpt(char*Pt_Text);
intmain(){
pt("asd");
return(0);
}
voidpt(char*Pt_Text){
chara[]="Tyon->:";
printf("%s\n",strcpy(a,Pt_Text));
}
试试.

++
回复

使用道具 举报

您需要登录后才可以回帖 登录 | 立即注册

本版积分规则

主题

0

回帖

4882万

积分

论坛元老

Rank: 8Rank: 8

积分
48824836
热门排行