Pages: [1]   Go Down
Author Topic: Char conversion error - need Char to send HTTP GET request....  (Read 416 times)
0 Members and 1 Guest are viewing this topic.
Offline Offline
Newbie
*
Karma: 0
Posts: 3
View Profile
 Bigger Bigger  Smaller Smaller  Reset Reset

I want to send GPS coordinates over GPRS via HTTP GET request but I have following problem.. I cant get the values into the request.
Below my code, has anybody an idea? Thank you !!!

My variables:

char latitude[20];
char longitude[20];

The function needs:

bool placeGetRequest(char* hostName, char* resourcePath, uint16_t dataSize){.....

My command:

placeGetRequest("www.google.com", "/index.html?lat="+=latitude+="&long"+=longitude, 500);

I get following error:
ScooterGPSalert:69: error: invalid operands of types 'const char [6]' and 'char [20]' to binary 'operator+'
ScooterGPSalert:69: error: in evaluation of 'operator+=(const char [6], char [20])'
Logged

Global Moderator
Offline Offline
Brattain Member
*****
Karma: 474
Posts: 18696
Lua rocks!
View Profile
WWW
 Bigger Bigger  Smaller Smaller  Reset Reset

You can't add string literals together like that.
Logged

Global Moderator
Offline Offline
Brattain Member
*****
Karma: 474
Posts: 18696
Lua rocks!
View Profile
WWW
 Bigger Bigger  Smaller Smaller  Reset Reset

Look up strcat, or sprintf.
Logged

Pages: [1]   Go Up
Jump to: