- 2
Increment
i ++ i =i+1 ++ i ???
3 Answers
+ 18
#include <iostream>
int main()
{
int i = 1;
i++; // i = 2
i = i + 1; // i = 3
++i; // i = 4
std::cout << i; // Output: 4
}
[http://cpp.sh/4ssy5]
+ 2
Yes, these operators make the same- when are used individually. Add 1 into i
But try such this
a=++i; // adding 1 before assign i into a
//versus
a=i++; // adding 1 after assign i into a
You will see the different in a.
+ 1
@Babak Sheykhan
Petr Hatina
thank you very
đđđđđđđ