Skip to main content
Post Closed as "Needs details or clarity" by VE7JRO, jsotola, Rohit Gupta
edited tags
Link
Nick Gammon
  • 38.9k
  • 13
  • 70
  • 126
More relevant post title
Link
Edgar Bonet
  • 45.2k
  • 4
  • 42
  • 81

calling arrays in void? Passing an array as an argument to a function

pleasePlease help how make it work, thanks.. :)

int myArray1[] = {10, 11, 12};
int myArray2[] = {15, 16, 17};


void setup() {
  Serial.begin(9600);
}

void loop() {

  myFunction(myArray1); delay(1000); // i want to use like this

}

void myFunction(int callArray) {
  for (int a = 0; a < 3; a++) {
    Serial.print(callArray[a]); Serial.print(" ");
  }
  Serial.println();
}

please help how make it work, thanks.. :)

int myArray1[] = {10, 11, 12};
int myArray2[] = {15, 16, 17};


void setup() {
  Serial.begin(9600);
}

void loop() {

  myFunction(myArray1); delay(1000); // i want to use like this

}

void myFunction(int callArray) {
  for (int a = 0; a < 3; a++) {
    Serial.print(callArray[a]); Serial.print(" ");
  }
  Serial.println();
}

Please help how make it work.

int myArray1[] = {10, 11, 12};
int myArray2[] = {15, 16, 17};


void setup() {
  Serial.begin(9600);
}

void loop() {

  myFunction(myArray1); delay(1000); // i want to use like this

}

void myFunction(int callArray) {
  for (int a = 0; a < 3; a++) {
    Serial.print(callArray[a]); Serial.print(" ");
  }
  Serial.println();
}
quote code.
Source Link
timemage
  • 5.7k
  • 1
  • 15
  • 27
Loading
Source Link
Loading