/* Hello Wokwi! */
int incomingByte = 0;
void setup() {
Serial.begin(9600);
int test[5] = {1, 2, 3, 4, 5};
int i;
int *buffer;
buffer = (int *)calloc(3, sizeof(int));
char output[80];
sprintf(output, "The global variable is stored at %u, the static array variable is stored at %u",&incomingByte, &test[0]);//use %x to get hex
Serial.println(output);
for(i = 0; i < 3; i++) {
buffer[i] = i;
sprintf(output, "The dynamic value stored at %u", &buffer[i]);// use %x to get hex
Serial.print(output);
Serial.print(" is ");
Serial.println(buffer[i]);
}
free(buffer);
}
void loop() {
}