Results 1 to 2 of 2

Thread: Using the ++ operator

  1. #1

    Thread Starter
    PowerPoster
    Join Date
    Jan 2008
    Posts
    11,074

    Using the ++ operator

    I have the following C code line

    pcon->gc.arghashk[++pcon->gc.ccm] = pste->hashkPc;

    My question what is being incremented? Is it the value in the variable .ccm? Also does the increment stay incremented through the remainder of the function or is it a temp increment for this line only?


    Anything I post is an example only and is not intended to be the only solution, the total solution nor the final solution to your request nor do I claim that it is. If you find it useful then it is entirely up to you to make whatever changes necessary you feel are adequate for your purposes.

  2. #2
    Sinecure devotee
    Join Date
    Aug 2013
    Location
    Southern Tier NY
    Posts
    6,113

    Re: Using the ++ operator

    It is incrementing the integer .ccm.
    It keeps the value for the life of the variable of .ccm.
    That code is in a loop making moves, so pcon->gc.ccm is keeping count of those moves.
    Last edited by passel; Feb 9th, 2015 at 05:23 PM.

Posting Permissions

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



Click Here to Expand Forum to Full Width