0
내가그것은 내 게시물 문자열 정수에 가입하는 것입니다,
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);
}
기본적으로 아두 이노에서이 코드를 세척하지 strcat와. 불행히도, 어떻게 든 성장하고 어떻게 든된다. GET /postTEST.php?first=0 GET /postTEST.php?first=01 GET /postTEST.php?first=012 나는 i를 늘린다.
어째서?
가 전달 된 정수 한 자리인가 :
는 또한 불필요한 단계는,이 같은 제안합니까? 그것은'strx [2] '를 사용하여 공간을 할당 한 것입니다. –