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

关于tempfile.exe出错,该怎么处理

2012-03-17 
关于tempfile.exe出错大家请看下面一段程序#includeiostream.h voidmain(){char*constpString asf p

关于tempfile.exe出错
大家请看下面一段程序

#include   "iostream.h "
void   main()
{
  char   *const   pString= "asf ";
  pString[0]= 'b ';
  cout < <*pString < <endl;
}

编译是没有错误的,但是运行起来却说tempfile.exe需要出问题需要关闭,关于tempfile.exe出错我已经不是第一次遇到了,这是怎么回事呢?向高手请教

[解决办法]
试图改变个字符串常量出错.

#include "iostream.h "
void main()
{
char a[] = "asf ";
char *const pString=a;
pString[0]= 'b ';
cout < <pString < <endl;
}

热点排行