Skip to main content
print -> bar
Source Link
Thomas S.
  • 566
  • 3
  • 8
  • 21

Please take a look at following example (I have Java background):

const char* BT_ADDRESS = "abcd,ef,ghijkl";

void printbar(const char* string) {
  ...
}

void foo() {
   printbar("AT+BIND=" + BT_ADDRESS);
   printbar("AT+LINK=" + BT_ADDRESS);
}

How to achieve this with "Arduino-C++" so BT_ADDRESS only has to be entered at one location?

Please take a look at following example (I have Java background):

const char* BT_ADDRESS = "abcd,ef,ghijkl";

void print(const char* string) {
  ...
}

void foo() {
   print("AT+BIND=" + BT_ADDRESS);
   print("AT+LINK=" + BT_ADDRESS);
}

How to achieve this with "Arduino-C++" so BT_ADDRESS only has to be entered at one location?

Please take a look at following example (I have Java background):

const char* BT_ADDRESS = "abcd,ef,ghijkl";

void bar(const char* string) {
  ...
}

void foo() {
   bar("AT+BIND=" + BT_ADDRESS);
   bar("AT+LINK=" + BT_ADDRESS);
}

How to achieve this with "Arduino-C++" so BT_ADDRESS only has to be entered at one location?

Source Link
Thomas S.
  • 566
  • 3
  • 8
  • 21

Concatenate string constants

Please take a look at following example (I have Java background):

const char* BT_ADDRESS = "abcd,ef,ghijkl";

void print(const char* string) {
  ...
}

void foo() {
   print("AT+BIND=" + BT_ADDRESS);
   print("AT+LINK=" + BT_ADDRESS);
}

How to achieve this with "Arduino-C++" so BT_ADDRESS only has to be entered at one location?