c++指针指向的内存问题
阿神
阿神 2017-04-17 13:50:12
0
2
541
#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 학습자의 빠른 성장을 도와주세요!