Skip to main content

You are not logged in. Your edit will be placed in a queue until it is peer reviewed.

We welcome edits that make the post easier to understand and more valuable for readers. Because community members review edits, please try to make the post substantially better than how you found it, for example, by fixing grammar or adding additional resources and hyperlinks.

Required fields*

2
  • Thanks a lot! If I interpret your answer and the link correctly, the following code works only with references, right? void fcn1(int &variable) { variable++; fcn2(variable); } void fcn2(int &variable) { Serial.println(variable); } void setup() { Serial.begin(9600); } void loop() { static int var = 1000; fcn1(var); delay(1000); } Many thanks! Commented Jan 31, 2018 at 20:47
  • Yes, however, it will not compile that way .. int & variable denotes a pointer, to increase it, you should use variable++. Commented Jan 31, 2018 at 20:50