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

c++中传递字符指针容易犯的异常

2012-09-05 
c++中传递字符指针容易犯的错误先看一段容易犯错的代码段:#includeiostreamusing namespace stdconst c

c++中传递字符指针容易犯的错误

先看一段容易犯错的代码段:

#include<iostream>using namespace std;const char* GetMe(){static char st[]="hello word!";//*st='t';return st;}int main(){const char *str;str=GetMe();cout<<str<<endl;return 0;}


热点排行