问题一:
int *Values;
Values = new int [n];
这个是否表示 Values 这个指针 也可以看作为数组 只能有n个元素?
问题 二:
void IntList(const int A[];
我传进去的是个数组?
那么我调用这个函数
怎么写 是
int B[8]; IntList(B); 这样写对么?
如果我用指针表示数组
int *B=new int [8];
IntList(B); 这样写对么?
如果对是否就可以认为我传进去的就必须是个地址
...全文
617打赏收藏
几个简单问题
问题一: int *Values; Values = new int [n]; 这个是否表示 Values 这个指针 也可以看作为数组 只能有n个元素? 问题 二: void IntList(const int A[]; 我传进去的是个数组? 那么我调用这个函数 怎么写 是 int B[8]; IntList(B); 这样写对么? 如果我用指针表示数组 int *B=new int [8]; IntList(B); 这样写对么? 如果对是否就可以认为我传进去的就必须是个地址