-
p是x的地址 *p是x的值。查看全部
-
申请块内存 int *arr=new int[10] delete[]arr查看全部
-
申请int*p=new int t 释放delete p查看全部
-
函数重载,名称相同,参数可变查看全部
-
递归函数无法使用内联函数查看全部
-
调用频繁的函数建议用内联函数查看全部
-
内联函数是建议性的,由编译器决定查看全部
-
加工费查看全部
-
#include <iostream> #include<stdio.h> using namespace std; int main(void) { int *p=new int [1000]; if(p==NULL) { system("pause"); return 0; } p[0]=10; p[1]=20; cout<<p[0]<<","<<p[1]<<endl; delete []p;//如果是delete则只删除p[0]; p=NULL; system("pause"); return 0; } /* #include <iostream> #include<stdio.h> using namespace std; int main(void) { int *p=new int (10); cout<<*p<<endl; delete p; p=NULL; system("pause"); return 0; }查看全部
-
int *const p;表示&p不可以改变 int const*p;表示*p不可以改变查看全部
-
块内存 int *arr=new int arr[10] delete []arr查看全部
-
int *p=new int delete p查看全部
-
new申请内存空间,delete释放内存空间。运算符查看全部
-
内联函数要求逻辑简单,不能是递归函数查看全部
-
const int *p 与int const *p等价。int const *p是控制*p不变,int *const p是控制p不变即p存储的内容始终为指向变量的地址。查看全部
举报
0/150
提交
取消