Hey. I am having a lot of trouble filling an empty array of char arrays ( strings) .
I want to scan wifi networks and fill my string array with nearby wifi names. I need to save this data because I will be using it later.
For now, I am trying to put "hello" string into my string array but I am getting an error and the device keeps restarting.

I really am not sure what is wrong here.
I want to scan wifi networks and fill my string array with nearby wifi names. I need to save this data because I will be using it later.
Code:
char *list_of_networks[10];//maximum number 10 strings inside array
void scan_wifi_networks(){
int n = WiFi.scanNetworks();
Serial.println("scan done");
if (n == 0) {
Serial.println("no networks found");
} else {
Serial.print(n);
Serial.println(" networks found");
for (int i = 1; i < n; i++) {
// Print SSID and RSSI for each network found
Serial.print(i + 1);
Serial.print(": ");
Serial.print(WiFi.SSID(i));
Serial.print(" (");
Serial.print(WiFi.RSSI(i));
Serial.print(")");
Serial.println((WiFi.encryptionType(i) == WIFI_AUTH_OPEN)?" ":"*");
delay(10);
//strcat(WiFi.SSID(i), list_of_networks);
//char buffer[50];
//WiFi.SSID(i).toCharArray(buffer, 50);
//char str_array[WiFi.SSID(i).length()];
//WiFi.SSID(i).toCharArray(str_array, WiFi.SSID(i).length());
char temp_buffer[100];
WiFi.SSID(i).toCharArray(temp_buffer, sizeof(temp_buffer));
Serial.print("temp_buffer=");
Serial.println(temp_buffer);
strcpy(list_of_networks[i],"hello");
Serial.println("OK");
}
}
Serial.println("");
}

I really am not sure what is wrong here.