64,682
社区成员
发帖
与我相关
我的任务
分享
#include <iostream>
#include <string.h>
using namespace std;
void main()
{
int *a[2]; // 指针数组
a[0]= new int[3]; // 使用 [] 和 () 的意思是啥咪? 其实我不明白整句的意思 ~~
a[1]= new int(5);
cout << a[0] << endl << a[1] << endl;
cout << *a[0] << endl << *a[1] << endl;
cout << (*a)[0] << endl << (*a)[1] << endl; // 为啥我用 *a[1] 和 (*a)[1] 的结果会不一样滴?
delete a[0];
delete a[1];
}