user13355: I'm working with an esp8266 and want to have it default to an access point when it cannot connect to a wifi network.  I'm using chriscook8's example from github here.
chriscook8 uses "+=" in several places and I can't find an explanation of what that means.
Here is an example from setup():
void setup() {
  Serial.begin(115200);
  EEPROM.begin(512);
  delay(10);
  Serial.println();
  Serial.println();
  Serial.println("Startup");
  // read eeprom for ssid and pass
  Serial.println("Reading EEPROM ssid");
  String esid;
  for (int i = 0; i < 32; ++i)
  {
    esid += char(EEPROM.read(i));  //<- here
  }

What does += do?

user23385: += is a common programming shortcut. An example: (pseudo-code)
num1 = 7
num2 = 15
#these two lines are exactly the same
num1 += num2
num1 = num1 + num2

+= is extremely useful for increasing the value of a variable by another variable. It also works similarly with -=, *=, and /=

user4143: It adds the value or variable on the right to the variable on the left and assigns the result to the variable on the left.
A += B

is the same as:
A = A + B

It's short-hand.
In the case of a String it concatenates the right hand item on to the end of the left hand item.

13355: <p>I'm working with an esp8266 and want to have it default to an access point when it cannot connect to a wifi network.  I'm using chriscook8's example from github <a href="https://github.com/chriscook8/esp-arduino-apboot/blob/master/ESP-wifiboot.ino" rel="nofollow">here</a>.</p>

<p>chriscook8 uses "+=" in several places and I can't find an explanation of what that means.</p>

<p>Here is an example from setup():</p>

<pre><code>void setup() {
  Serial.begin(115200);
  EEPROM.begin(512);
  delay(10);
  Serial.println();
  Serial.println();
  Serial.println("Startup");
  // read eeprom for ssid and pass
  Serial.println("Reading EEPROM ssid");
  String esid;
  for (int i = 0; i &lt; 32; ++i)
  {
    esid += char(EEPROM.read(i));  //&lt;- here
  }
</code></pre>

<p>What does += do?</p>
 23385: <p><code>+=</code> is a common programming shortcut. An example: (pseudo-code)</p>

<pre><code>num1 = 7
num2 = 15
#these two lines are exactly the same
num1 += num2
num1 = num1 + num2
</code></pre>

<p><code>+=</code> is extremely useful for increasing the value of a variable by another variable. It also works similarly with <code>-=</code>, <code>*=</code>, and <code>/=</code></p>
 4143: <p>It adds the value or variable on the right to the variable on the left and assigns the result to the variable on the left.</p>

<pre><code>A += B
</code></pre>

<p>is the same as:</p>

<pre><code>A = A + B
</code></pre>

<p>It's short-hand.</p>

<p>In the case of a String it concatenates the right hand item on to the end of the left hand item.</p>
