int main()
{
int i=0;
int* p_numbers = ((int*) malloc (5*sizeof(int)));
int* temp;
temp = p_numbers;
for(i=0;i<5;i++)
{
*temp=i;
printf("temp %d p_numbers %d",*temp,*p_numbers);
temp++;
}
}
請指出分配給temp
的指針,即temp=p_numbers
。C指針和臨時變量
DOES temp
不指向p_numbers
指向的同一內存位置?
不錯的解釋....謝謝:) – anshulkatta 2013-02-14 05:15:41