Hi
I have read that intensive string concantenation is memory hungry and I could use a little help.
I have a very large integer array of analogue readings and I need to parcel them up to send over a socket connection.
Is there a better way?
int JMarray[900];
..... ( populate array) ....
String timestr=String(now());
int arrayValue;
String str="";
String FullString;
FullString+= timestr;
FullString+= ",";
for(int i=0; i<=900; i++) {
arrayValue=JMarray;
str = String(arrayValue);
FullString+=str;
FullString+=",";
}
.........
server.println(FullString);
I have read that intensive string concantenation is memory hungry and I could use a little help.
I have a very large integer array of analogue readings and I need to parcel them up to send over a socket connection.
Is there a better way?
int JMarray[900];
..... ( populate array) ....
String timestr=String(now());
int arrayValue;
String str="";
String FullString;
FullString+= timestr;
FullString+= ",";
for(int i=0; i<=900; i++) {
arrayValue=JMarray;
str = String(arrayValue);
FullString+=str;
FullString+=",";
}
.........
server.println(FullString);
Last edited: