user18795: With the source code below, I'm getting what I think to be strange behaviour with the serial port output.
void setup() {
  Serial.begin(9600);
}

int c = 0;    
void loop() {
  Serial.println(c++);
}

Presumably what this will do is starting printing incrementing numbers, one on each line, starting from 0. However, my serial monitor only starts printing these numbers after the 3000 mark. I found this behaviour only after discovered in another sketch that I was losing data at the beginning.
Is this normal Arduino behaviour? Or a serial monitor problem? Or something else?

user14737: Is this a Leonardo or Yun?  If it is, you have to wait until the Serial object says the USB connection is really ready:
void setup() {
  Serial.begin(9600);
  while (!Serial) {
    ; // wait for serial port to connect. Needed for native USB
}

Read this.
Because you did't wait, your loop is able to execute 3000 times before Serial actually sends something back to the PC.

18795: <p>With the source code below, I'm getting what I think to be strange behaviour with the serial port output.</p>

<pre><code>void setup() {
  Serial.begin(9600);
}

int c = 0;    
void loop() {
  Serial.println(c++);
}
</code></pre>

<p>Presumably what this will do is starting printing incrementing numbers, one on each line, starting from 0. However, my serial monitor only starts printing these numbers after the 3000 mark. I found this behaviour only after discovered in another sketch that I was losing data at the beginning.</p>

<p>Is this normal Arduino behaviour? Or a serial monitor problem? Or something else?</p>
 14737: <p>Is this a Leonardo or Yun?  If it is, you have to wait until the <code>Serial</code> object says the USB connection is really ready:</p>

<pre><code>void setup() {
  Serial.begin(9600);
  while (!Serial) {
    ; // wait for serial port to connect. Needed for native USB
}
</code></pre>

<p>Read <a href="https://www.arduino.cc/en/Serial/IfSerial" rel="nofollow">this</a>.</p>

<p>Because you did't wait, your <code>loop</code> is able to execute 3000 times before <code>Serial</code> actually sends something back to the PC.</p>
