假设我想打印出存储在“数组”中的整数,这确实是内存中的一个指针。当我使用代码时:
int main(void)
{
int *arr = malloc(3*sizeof(int));
int *p = arr;
*arr++=1;
*arr++=2;
*arr=3;
while (??) // what should be filled in the while?
printf("%d",*p); // so that we can get the validly stored elements?
return 0;
}