Frankthetech
Well-known member
Hi, I'm trying to figure out how these two code blocks differ.
the first function takes the int toWait without the & sign, both work but the 1 with the & compiles a few bytes larger.
Is one way better/safer.
Code:
void dotWait(int toWait){
uint32_t startMillis=millis();
while(millis()<=(startMillis+toWait)){
Serial.print(".");
delay(200);
}
Serial.println();
}
Code:
void dotWait(int &toWait){
uint32_t startMillis=millis();
while(millis()<=(startMillis+toWait)){
Serial.print(".");
delay(200);
}
Serial.println();
}
the first function takes the int toWait without the & sign, both work but the 1 with the & compiles a few bytes larger.
Is one way better/safer.