Tuesday, October 4, 2011

c++的prefix ++ 跟postfix ++

在stackoverflow看到了pre-increment 跟post-increment的問題
http://stackoverflow.com/questions/7397740/post-increment-operator

才發現c++這跟c是不一樣的
prefix increment是return lvalue
postfix inc 是return rvalue

另外還有古老的com.std.c++的討論
http://groups.google.com/group/comp.std.c++/browse_thread/thread/7804d1fdf2f05a1c

回文裡面可是有幾位大師呢

No comments: