hello,i want to store data getting from ble scan i.e.storing_data1.length() and add it to 2D array.....
i write function like n = storing_data1.length();
char char_array[20][70]; // declaring character array
strcpy(char_array[n], storing_data1.c_str()); // copying the contents of the string to char array
for (int i = 0; i < n; i++)
{
for (int j = 0; j < n; j++)
{
myArray[nr][nc] = myArray[nr][nc]++;
Serial.print(char_array[i][j]);
}
Serial.print(char_array[i][j]);
}
can anyone please help mw out i am new at this platform........thank you
void setup() {
// put your setup code here, to run once:
char char_array[10][10]; // declaring character array
Serial.begin(115200);
for (int i = 0; i < 10; ++i) {
//dummy data from ble scan ;)
String str = "String #";
str += String(i + 1, DEC);
//
memcpy(&char_array[i][0], str.c_str(), str.length() + 1); //store data from string to 2D array
}
for (int j = 0; j < 10; ++j) {
Serial.println(char_array[j]); //print out 2D array
}
}
void loop() {
// put your main code here, to run repeatedly:
}
@sherzaad when i refer code suggest by you i am getting output like in screenshot data get overlapped not get append......please suggest me something....
thank you....