SA-MP Forums Archive
Little question - Printable Version

+- SA-MP Forums Archive (https://sampforum.blast.hk)
+-- Forum: SA-MP Scripting and Plugins (https://sampforum.blast.hk/forumdisplay.php?fid=8)
+--- Forum: Scripting Help (https://sampforum.blast.hk/forumdisplay.php?fid=12)
+--- Thread: Little question (/showthread.php?tid=427039)



Little question - Salim_Karaja - 31.03.2013

what is the diffrence between:
++i
to
i++


Re: Little question - emokidx - 31.03.2013

++i will increment the value of i, and then return the incremented value.
i++ will return the pre-incremented value and then increment the value of i.

http://stackoverflow.com/questions/2...etween-i-and-i


Re: Little question - Salim_Karaja - 31.03.2013

Quote:
Originally Posted by emokidx111
Посмотреть сообщение
++i will increment the value of i, and then return the incremented value.
i++ will return the pre-incremented value and then increment the value of i.

http://stackoverflow.com/questions/2...etween-i-and-i
Thanks


Re: Little question - Gamer_007 - 31.03.2013

If u will study C language,you will study Pre-Increment and Post-Incremet.

Pre-Increment = First use then change

and

Post-Increment = First use then change.

In ur question ++i = pre-increment and i++ = post-increment


Re: Little question - Abhishek. - 31.03.2013

If u will study Java language,you will study Pre-Fix and Post-Fix.

Pre-Fix = change and then use.

and

Post-Fix = use and then change.

In ur question ++i = pre-fix and i++ = post-fix


Re: Little question - RajatPawar - 31.03.2013

Quote:
Originally Posted by Gamer_007
Посмотреть сообщение
If u will study C language,you will study Pre-Increment and Post-Incremet.

Pre-Increment = First use then change

and

Post-Increment = First use then change.

In ur question ++i = pre-increment and i++ = post-increment
Quote:
Originally Posted by [bot]fatninja
Посмотреть сообщение
If u will study Java language,you will study Pre-Fix and Post-Fix.

Pre-Fix = change and then use.

and

Post-Fix = use and then change.

In ur question ++i = pre-fix and i++ = post-fix
I just found the difference of:
Quote:
Originally Posted by Gamer_007
Посмотреть сообщение
C language
Quote:
Originally Posted by [bot]fatninja
Посмотреть сообщение
Java language
Did you like, copy paste it !? Anyways, the question was already answered.
Also, by the way, @ Gamer_007, it's C++ ! C is a different language.