私はarduinoでこのコードを持っています
void function(int x){
char* response="GET /postTEST.php?first=";
char strx[2] = {0};
int num = x;
sprintf(strx, "%d", num);
original=response;
strcat(response,strx);
Serial.println(response);
//memset(response,'\0',80);
}
基本的には、投稿文字列に整数を結合することです。残念ながらなんとなく大きくなり、 i を大きくしていくと GET /postTEST.php?first=0 GET /postTEST.php?first=01 GET /postTEST.php?first=012 となります。
どうして?