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