what is the difference between i++ and ++ i ?
i = 1;
j = ++i;
(i is 2, j is 2)
//diference
i = 1;
j = i++;
(i is 2, j is 1)
what is the difference between i++ and ++ i ?
i = 1;
j = ++i;
(i is 2, j is 2)
//diference
i = 1;
j = i++;
(i is 2, j is 1)
the difference between i++ and ++i
i = 1;
j = i++;
(i is 2, j is 1)
++i vs i++
// ++i will increment the value of i, and then return the incremented value.
i = 1;
j = ++i;
(i is 2, j is 2)
// i++ will increment the value of i, but return the original value that i held before being incremented.
i = 1;
j = i++;
(i is 2, j is 1)
Copyright © 2021 Codeinu
Forgot your account's password or having trouble logging into your Account? Don't worry, we'll help you to get back your account. Enter your email address and we'll send you a recovery link to reset your password. If you are experiencing problems resetting your password contact us