首页 诗词 字典 板报 句子 名言 友答 励志 学校 网站地图
当前位置: 首页 > 教程频道 > 开发语言 > C语言 >

)c遇有关问题

2012-06-14 
求助)c遇问题void MessageBox(string title,string test){int x10,y10char chfor(y10y20y++){goto

求助)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++的

热点排行