![将 int类型数据给 char resp[3]变量](http://pic.xiahunao.cn/yaotu/将 int类型数据给 char resp[3]变量)
将 int类型数据给 char resp[3]变量int cereg; // cereg大小范围 0~10 modem_get_cereg(cereg); // 因为 cereg值最大可为 10,则至少需要 3字节空间 // 才能复制给 resp char resp[3] {0}; snprintf(resp, sizeof(resp), %d, cereg); // 只需传前面两个有效数据所以为2 // 第3位为字符串结束标识符 \0 TciSendCmdResp(handle, cmd, resp, 2);