[C++] 淺談 i++ 與 ++i 之效率問題

出社會後才發現i++與++i在效率上的差別,簡單來說...
  • i++
    • Compiler 會產生一個位置去暫存i的值
  • ++i
    • 直接返回i的值

留言

這個網誌中的熱門文章

[CentOS, OpenCV] CentOS 7 安裝 OpenCV 3.4.5 (CentOS install OpenCV )

[CGAL, BOOST, C++, Visual Studio] Mutex is not supported when compiling with /clr or clr:pure