Concatenate

Hello everybody,

I need to concatenate two floats and three strings (or chars? well a group of words) and put them althogether in a:

Char direction [] =

So the final structure would be sth like this:

Char direction [] = "GET /msgs/api/v1.0/arduino?lon=" + longitude + "&lat=" + latitude +

"HTTP/1.1\r\nHost: hello.herokuapp.com\r\nConnection:close\r\n\r\n"

Where longitude and latitude are floats. If string+float it's too difficult, maybe I can multiply the float * 1000 and make it int? string+int then. Or maybe string+string.

But the thing is I need to put it on a char.

Thank you so much for reading.

I need to concatenate... into one big array

Are you sure? Most internet interfaces allow you to write the pieces:

 client.print( F("GET /msgs/api/v1.0/arduino?lon=") );
  client.print( longitude );
  client.print( F("&lat=") );
  client.print( longitude );
      ...

There are usually two ways to write content like this:

(1) write the content length, then write the content; or

(2) write the content, then write a special terminator (e.g., ctrl-Z, (char) 26, blank lines, etc.).

The first way is more awkward on the Arduino, because it doesn't have much RAM. The second way is much more efficient, because you can write the pieces without having to count the number of characters.

Give us the complete sketch (in code tags or attach the .INO), and we can make more specific suggestions.

Cheers,
/dev