This content originally appeared on DEV Community and was authored by PC Yang
剛開始寫C++就遇到了此問題,可能對很多人來說是簡單到不行的問題,但實際使用才發現自己對兩者差異不是很熟
許多大神的解釋過於艱深,我實在難以理解(我的問題)
然而,其實用一個例子就能懂,什麼是
X++ is post increment and ++x is pre increment.
舉例:
For ++x
Output: 6,6
For x++
Output: 5,6
This content originally appeared on DEV Community and was authored by PC Yang

PC Yang | Sciencx (2025-01-21T08:50:57+00:00) [菜雞刷題日記] x++ 與++x 的差別?其實很容易懂!. Retrieved from https://www.scien.cx/2025/01/21/%e8%8f%9c%e9%9b%9e%e5%88%b7%e9%a1%8c%e6%97%a5%e8%a8%98-x-%e8%88%87x-%e7%9a%84%e5%b7%ae%e5%88%a5%ef%bc%9f%e5%85%b6%e5%af%a6%e5%be%88%e5%ae%b9%e6%98%93%e6%87%82%ef%bc%81/
Please log in to upload a file.
There are no updates yet.
Click the Upload button above to add an update.