联系
Knight's Tale » 技术

Somthing about "++i"

2010-08-14 15:28

"++i" return a reference of the "i" object, it's a left-hand value. It's more effective than "i++".

int i = 0;
++i  =4;
std::cout << i << std::enld; // 4

Reference:

http://knightkid.blog.35.cn/2009/11/14/zhuanguanyuiheizaiczhongdexiaolvwenti/

本文链接地址:Somthing about "++i"