请解释代码最后一行的输出。为什么0x23fe3a短路时是2个字节?为什么在0x23fe3a之后0x23fe36?输出是:
0x23fe34
0x23fe36
0x23fe3a 0x23fe36 0x23fe3a
#include<iostream>
using namespace std;
int main()
{
short num=77;
short* sptr = #
cout<<"Pointer to short"<<endl;
cout<<sptr-1<<endl<<endl;
cout<<sptr<<endl;
cout<<++sptr<<" "<<sptr++<<" "<<sptr<<endl;
}
但如果我将最后一行分成两行,我得到正确的输出。
0x23fe34
0x23fe36
0x23fe38 0x23fe38 0x23fe3a
cout<<++sptr;
cout<<" "<<sptr++<<" "<<sptr<<endl;
为什么会这样?