Go Down

Topic: What is wrong with this String? (Read 304 times) previous topic - next topic

Apimyself

This is my string:

String pos = String(gps.location.lat(), 5)) + String(gps.location.lng(), 4));

And the error is :

error: expected ',' or ';' before ')' token

Gippopotam

This is my string:

String pos = String(gps.location.lat(), 5)) + String(gps.location.lng(), 4));

And the error is :

error: expected ',' or ';' before ')' token
String pos = String(gps.location.lat(), 5) + String(gps.location.lng(), 4);

wvmarle

You can save yourself a lot of memory (and potential problems later) by using char arrays instead of the String class.
Quality of answers is related to the quality of questions. Good questions will get good answers. Useless answers are a sign of a poor question.

Apimyself

You can save yourself a lot of memory (and potential problems later) by using char arrays instead of the String class.
Thanks in advice!

PaulMurrayCbr

Having said that, the problem you are having with that line not compiling is pretty simple.
http://paulmurraycbr.github.io/ArduinoTheOOWay.html

srnet

This is my string:

String pos = String(gps.location.lat(), 5)) + String(gps.location.lng(), 4));

And the error is :

error: expected ',' or ';' before ')' token
In that line of code you have some opening brackets and some closing brackets, it seems reasonable that there is should a matching number of opening brackets and closing brackets.

Is there ?
$50SAT is now Silent (but probably still running)
http://www.50dollarsat.info/
http://www.loratracker.uk/

Go Up