I can't figure out why test is not passed properly to test1
#include <Arduino.h>
char *test1;
char *status_reply(char *test) {
int ans_rel = 1;
int ans_led = 0;
int ans_sw = 1;
sprintf(test,"%d%d%d",ans_rel,ans_sw,ans_led);
Serial.println(test);
}
void setup() {
Serial.begin(9600);
status_reply(test1);
Serial.println(test1);
}
void loop() {
// put your main code here, to run repeatedly:
}