C++new用法

版权声明:皆为本人原创,复制必究 https://blog.csdn.net/m493096871/article/details/89923376

#include <iostream.h>
int main(){
    int *p =new int[10];
    for (int i =0;i<10;i++)
        p[i]=i*i;
    for (int i =0;i<10;i++)
        cout<<p[i]<<endl;

    delete [] p;
    system("pause");
    return 0;
}

猜你喜欢

转载自blog.csdn.net/m493096871/article/details/89923376
今日推荐