static_cast数值类型的转换
const_cast 临时去掉const限制
reinterpret_cast任意两种类型指针转换
static_cast<int>(45.7);
static_cast <int *>calloc(size of (int),10);
const int k=5;
const_cast<int&>(k);
reinterpre_cast<int*>(&f);
new 类型。
(类型*)malloc(sizeof(类型))
*p=static_cast<int*>(malloc(sizeof(int)));
与*q=new int;等效。
delete p;
delete [] a;
new与delete配对使用。
动态数组没有理由初始化。
本内容试读结束,登录后可阅读更多
下载后可阅读完整内容,剩余1页未读,立即下载