Home | Help Forums | Web Design Tutorials | Free Swishmax Downloads | All Downloads

 

 

Company

Home

Nework Details

Tutorials

SWiSH 2

SWiSHMax

Flash MX

PHP & MySQL

HTML / JScript

Adobe Photoshop

Corel Draw

Gimp

Miscellaneous

Downloads

Templates

Plugins

Fonts

Wallpapers

Free Images

Scripts and Codes

Products

E-Books

SWiSH BB

SWiSH Templates

SWiSH-DB Newsletter
Subscribe to our newsletter : GO
  Partners / Affiliates

   Swish Templates
   SWiSH Climax
   GimpTalk
   Idea Designs
   Sposatoettore
   Try Acai Berry Diet
   Download Free Ringtones
   Swishzone

Manage your site with Flax Article Content Management System
Increment operators, prefix or suffix ?
Category : SWiSHMax | Level : Beginner | Language : English
Ask Question | Read Comments | Post tutorial | Previous | Next

Web www.swish-db.com

BEGINNERS TUTORIAL

Hi,

This is a small but important tutorial about increment operators used as prefix or as suffix. What is the difference ?

Base
B=45
B++ //B=B+1

Result will be B=46

example
B=45
A=B++

Result will be B=46 BUT A=45 !

Why ? : Because the value of B was given to variable A BEFORE the increment of variable B.


example
B=45
A=++B

Result will be B=46 and A=46

Why ? : Because the value of B was given an increment BEFORE passing it to variable A.

The same for decrement operator !

Regards.









All rights reserved - swish-db.com