How are increment and decrement operators used in loops (that's all I know, they're used in loops). But how are they used in loops, and when are they used? Aren't * and / (multiplication and division) operators too?
Operators (increment and decrement)
Started by Sionofdarkness, Jul 22 2006 12:23 PM
3 replies to this topic
#1
Posted 22 July 2006 - 12:23 PM
|
|
|
#2
Posted 23 July 2006 - 06:21 AM
increment and decrement operators are unary (1 operand) whereas +, -, *, / are binary (2 operands). Increment and decrement are used anywhere you want to quickly and efficiently increase/decrease a value by 1. This occurs frequently in for loops, but can happen in a wide range of places, such as counting the occurances of 'a' in the string "A long way away was a cute little kitten."
#3
Guest_NeedHelp_*
Posted 24 July 2006 - 11:26 AM
Guest_NeedHelp_*
WingedPanther said it perfectly.
#4
Posted 29 July 2006 - 09:08 AM
Now that I think about it, I can imagine quite a few scenarios in which that could be used...


Sign In
Create Account


Back to top









