c++指针指向的内存问题
阿神
阿神 2017-04-17 13:50:12
0
2
542
#include <iostream>
#include <cstring>
#include <string>

using namespace std;

int main()
{

    int* str = new int[1];
    str[2] = 1;
    cout << str[2] << endl;
    return 0;
}

为什么这段代码可以正常运行哦?str不是指向的一个大小的内存吗?

阿神
阿神

闭关修行中......

熱門教學
更多>
最新下載
更多>
網站特效
網站源碼
網站素材
前端模板
關於我們 免責聲明 Sitemap
PHP中文網:公益線上PHP培訓,幫助PHP學習者快速成長!