Author: steve happ | Email
Website : www.video-animation.com
Advertisement
Increment and decrement Operators ( ++ and -- )
The increment (++) and decrement (--) operators are a shortcut way of adding or subtracting 1 from a variable. E.g.
Prefix increment - ++c; // c = c+1
Postfix increment - c++;
The prefix form of ++ increments the value of the variable before that value is used.
stack[++top] = val;
//Is equivalent to the following 2 lines
top = top +1;
stack[top] = val;
The postfix form of ( --) decrements the value of top after that value is used.
stack[top--] = val;
//Is equivalent to :
stack[top] = v;
top = top -1;
Arithmetic "IF" operator
The syntactic form is:
Expression1 ? expr2 : expr3 ;
If expression1 evaluates to a true condition, then expression2 is evaluated, otherwise expression3 is evaluated. E.g.
x = 2;
y = 5;
max = x<y ? 100 : 10;
trace(max);
We hope the information helped you. If you have any questions
or comments, please don't hesitate to post them on the
Forums section
Submit your Tutorial at Click Here