问题描述
std::vector<int> v = {10,20,30};
auto it = v.begin();
std::cout << *it++ << std::endl; // 1. no parenthesis
std::cout << *(it++) << std::endl; // 2. with parenthesis
it++; // 3. post-increment first
std::cout << *it << std::endl;
std::cout << *(it + 1) << std::endl;// 4. increment index
以上4种说法有什么区别?括号在后增量中重要吗?所有输出都与我的期望相同,除了 2(带括号)。
解决方法
暂无找到可以解决该程序问题的有效方法,小编努力寻找整理中!
如果你已经找到好的解决方法,欢迎将解决方案带上本链接一起发送给小编。
小编邮箱:dio#foxmail.com (将#修改为@)