#include <iostream> using namespace std; int main() { int b=3; int arr[]={6,7,8,9,10}; int *ptr=arr; *(ptr++)+=123; cout<<*ptr<<' '<<*(++ptr)<<endl; return 0; }
输出结果为:
8 8
注意:printf和cout一样都是从右到左压栈的。
#include <iostream> using namespace std; int main() { int b=3; int arr[]={6,7,8,9,10}; int *ptr=arr; *(ptr++)+=123; cout<<*ptr<<' '<<*(++ptr)<<endl; return 0; }
输出结果为:
8 8
注意:printf和cout一样都是从右到左压栈的。
转载于:https://www.cnblogs.com/hunterzhang/p/3167131.html