阅读背景:

为什么这个简单的字符串赋值是segfault?

来源:互联网 

I’ve got the following code:

我有以下代码:

#include <iostream>
using namespace std;
int main()
{
    char* a = "foo";
    char* b = "bar";
    a = b;
    cout << a << ", " << b << endl;
    return 0;
}
#inclu



你的当前访问异常,请进行认证后继续阅读剩余内容。

分享到: