两种方法:
1. 使用_itoa函数:
#include <stdlib.h>
char temp[10];
int pStorDepthAttrValue;
_itoa(pStorDepthAttrValue, temp, 10);
memcpy(sendDataBuf, temp, strlen(temp));
2. 使用sprintf函数:
int pStorDepthAttrValue;
sprintf(sendDataBuf, "%d", pStorDepthAttrValue);
第二种方法更加简洁方便。