I have this json code:
char json[] = "{\"icon\": \"partlycloudy\",
\"icon_url\": \"http://icons-ak.wxug.com/i/c/k/partlycloudy.gif\"}";
How do I resolve this error: 'missing terminating " character error'?
I have this json code:
char json[] = "{\"icon\": \"partlycloudy\",
\"icon_url\": \"http://icons-ak.wxug.com/i/c/k/partlycloudy.gif\"}";
How do I resolve this error: 'missing terminating " character error'?
try:
char json[] = "{\"icon\": \"partlycloudy\",\"icon_url\": \"http://icons-ak.wxug.com/i/c/k/partlycloudy.gif\"}";
Use an additional backslash
char json[] = "{\"icon\": \"partlycloudy\",\
\"icon_url\": \"http://icons-ak.wxug.com/i/c/k/partlycloudy.gif\"}";
That way, the compiler will escape (ignore) the and/or at the end of the first line. Be aware that all spaces at the beginning of the second line will be part of the text, so you might want to move the text on the second line to the beginning of that line.
sterretje:
you might want to move the text on the second line to the beginning of that line.
Is there any way to enable word wrap in arduino IDE?
I feel that using the automatic concatenation of consecutive string-literals is a better possibitity.
char json[] = "{\"icon\": \"partlycloudy\","
"\"icon_url\": \"http://icons-ak.wxug.com/i/c/k/partlycloudy.gif\"}";