1. Welcome to TechPowerUp Forums, Guest! Please check out our forum guidelines for info related to our community.

what does this command do?

Discussion in 'Programming & Webmastering' started by ste2425, Apr 10, 2013.

  1. ste2425

    ste2425

    Joined:
    May 27, 2008
    Messages:
    3,369 (1.51/day)
    Thanks Received:
    366
    Location:
    Huddersfield, uk
    Code:
     mod += control;
    I found this line in some code im adapting for my needs. The rest looks perfectly straight forward but ive never come across this command before. Im work on a DSP development board using C. It all works fine but im struggling to fully understand whats happening thanks to this.

    Thanks all Stephen
  2. Aquinus

    Aquinus Resident Wat-man

    Joined:
    Jan 28, 2012
    Messages:
    5,888 (6.56/day)
    Thanks Received:
    1,888
    Location:
    Concord, NH
    Code:
    mode += control;
    It says take the value of mode and add the value of control to it. You're just accumulating the "mode" variable. So if mode was 10 and control was 5, after executing this you would have mode = 15.
    ste2425 says thanks.
  3. W1zzard

    W1zzard Administrator Staff Member

    Joined:
    May 14, 2004
    Messages:
    14,632 (3.94/day)
    Thanks Received:
    11,363
    Code:
    mod += control;
    same as

    Code:
    mod = mod+control;
    just shorter to write
    ste2425 says thanks.
  4. ste2425

    ste2425

    Joined:
    May 27, 2008
    Messages:
    3,369 (1.51/day)
    Thanks Received:
    366
    Location:
    Huddersfield, uk
    ooooooh everything's just fallen into place, many thanks :)

Currently Active Users Viewing This Thread: 1 (0 members and 1 guest)

Share This Page