new会调用构造函数,主要的数据类型(char,int,float)会被new初始化 1234567891011 #include<iostream>using namespace std;int (){ int *n = new int(10); cout<<*n; getchar(); return 0;} new是操作符,malloc()是函数 new返回指定的数据类型,malloc()返回void* 赞微海报分享
近期评论