According to syntax postfix increment returns copy of unmodified variable (C++ == C), while prefix increment returns incremented variable (++C == C + 1).

  • @Blue_Morpho
    link
    4
    edit-2
    2 hours ago

    ???

    If c = 1, then c++ = 2

    #include <iostream> using namespace std;

    int main() {

    int i = 10;

    cout << i++ << endl;

    cout << i << endl;

    }

    postfix ++ increments the variable.

    • @[email protected]OP
      link
      fedilink
      42 hours ago

      Postfix increments variable too, but as a side effect. in your code cout << i++ << endl; prints 10 which means, that i++ returned copy of unincremented i.