#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)栈是先进后出
标签:显示,str,int,char,数组,指针 From: https://www.cnblogs.com/ruoye123456/p/16945993.html