C question with pointers

后端 未结 4 1566
慢半拍i
慢半拍i 2021-01-27 20:40

I have a program question, here is the code.

int main()
{
int *p,*q;
p=(int*)1000;
printf(\"%d \",p);
q=(int*)2000;
printf(\"%d\",q);
printf(\"%d\",(p-q));
retu         


        
4条回答
  •  春和景丽
    2021-01-27 21:39

    So much undefined behaviour in this program, the values printed are really quite immaterial.

提交回复
热议问题