Hello and welcome to our community! Is this your first visit?
Register
Enjoy an ad free experience by logging in. Not a member yet? Register.
Results 1 to 5 of 5

Thread: HELP: i++

  1. #1
    New Coder
    Join Date
    Jun 2005
    Posts
    33
    Thanks
    7
    Thanked 0 Times in 0 Posts

    Question HELP: i++

    totalSum[sumOne()-1] ++;

    How would you write the code another way ++?
    I know how ex. i++ i=i+i, but don't know the above.

  • #2
    New Coder
    Join Date
    Jun 2005
    Posts
    33
    Thanks
    7
    Thanked 0 Times in 0 Posts
    please someone...

  • #3
    Regular Coder
    Join Date
    Dec 2002
    Location
    a bit west of pittsburgh
    Posts
    236
    Thanks
    1
    Thanked 0 Times in 0 Posts
    sounds like a homework exercise... this should get you thinking in the right direction.

    var index = sumOne()-1;
    var tot = totalSum[index];
    tot++;

  • #4
    New Coder
    Join Date
    Jun 2005
    Posts
    33
    Thanks
    7
    Thanked 0 Times in 0 Posts
    thanks , can you write the code without the ++?

  • #5
    Regular Coder
    Join Date
    May 2004
    Location
    Berkeley, California Age: 15
    Posts
    398
    Thanks
    0
    Thanked 0 Times in 0 Posts
    tot++; is just a simple way of saying

    tot = tot + 1;

    Why do you want to avoid ++?
    Jalenack.com .:. YWDA Founder .:. Rounded Corners Maker 1.1! .:. My Blog
    The hardest thing about teaching is not knowing the right answers, but knowing the right questions - Elisabeth Klein
    Pretty buttons does not a great website make.


  •  

    Posting Permissions

    • You may not post new threads
    • You may not post replies
    • You may not post attachments
    • You may not edit your posts
    •