Thread: += operator?

    #1
  1. Contributing User
    Devshed Newbie (0 - 499 posts)

    Join Date
    Nov 2002
    Posts
    421
    Rep Power
    12

    += operator?


    I have long fogoton the += -= and all those operators. I am looking at a 2d array and came across this:

    for (int i=0; i<maxrow; i++)
    {
    sum += array2d[0][i];

    etc. etc.
    }

    does the += equal all the i's together?

    EDIT:: Did i just call them operators?
    hmmm...
  2. #2
  3. No Profile Picture
    Contributing User
    Devshed Beginner (1000 - 1499 posts)

    Join Date
    Feb 2001
    Posts
    1,481
    Rep Power
    15
    sum += num;

    is equivalent to:

    sum = sum + num;
  4. #3
  5. Contributing User
    Devshed Newbie (0 - 499 posts)

    Join Date
    Nov 2002
    Posts
    421
    Rep Power
    12
    thats right..
    hmmm...

IMN logo majestic logo threadwatch logo seochat tools logo