精華區beta Programming 關於我們 聯絡資訊
※ 引述《ast.bbs@bbs.sayya.org (ast)》之銘言: > #include <stdio.h> > void fun1(int *n); > int main() > { > int x = 12; > int *y; > y=&x; > fun1(y); > printf("*x = %d\n",x); > return 0; > } > void fun1(int *n) > { > *n = *n++ + --*n; > } > 這印出是22可是,為什麼啊? > *n++ 那時是12我可以理解 > --*n卻等於10 ??請問我哪裡的觀念錯誤勒? *n = *n++ + --*n; 拆開來 --*n; *n = *n + *n; n++; -- ※ Origin: 元智大學 風之塔 <bbs.yzu.edu.tw> ※ From : bbs.yzu.edu.tw ※ X-Info: Re: [問題]i++ + --i =? ※ X-Sign: 10TJGAEZxWmoWTheNrUA (05/01/04 6:03:58 )