#include"iostream"
using namespace std;
int main(void)
{
   char str[]="1234567890";
   int*p=(int*)str;
   printf("%x\n",*(p+1));//0x38373635
   cout<<*(p+1)<<endl;//943142453
   cout<<*((char*)(p+1))<<endl;//5
   return 0;
}

本题数据显示的原因

、(1)是char转int赋给的是ascii码

   (2)栈是先进后出

 posted on 2022-12-02 23:24  ruoye123456  阅读(33)  评论(0)    收藏  举报