求助)c遇问题
void MessageBox(string title,string test)
{
int x=10,y=10;
char ch;
for(y=10;y<20;y++)
{
gotoxy(10,y);
for(x=10;x<30;x++)
{
if(y==10||y==19||y==12)printf("-");
else if(x==10||x==29)printf("|");
else printf(" ");
}
printf("\n");
}
gotoxy(26,11);printf("|×");
gotoxy(24,11);printf("|-");
gotoxy(11,11);printf("%s",title);
gotoxy(13,15);printf("%s",test);
gotoxy(23,18);printf("|确认Y");
gotoxy(17,18);printf("|取消N");
ch=getch();
if(ch=='y'||y=='Y')keyPool=1;
else if(ch=='n'||ch=='N')keyPool=0;
}
编译后说string不能用在这!这是怎么回事?换成char能通过!可以用其它的代替吗?
[解决办法]
string是你自己定义的类型吗?C语言没有这个关键字吧,如果想输入字符串的话,可以使用char*来实现。
[解决办法]
C语言里面没有string类型, 除非自己定义。string是c++的