This thread has been locked.

If you have a related question, please click the "Ask a related question" button in the top right corner. The newly created question will be automatically linked to this question.

[参考译文] CCS/CC2650:将字符缓冲区数据复制到整型变量

Guru**** 2526700 points


请注意,本文内容源自机器翻译,可能存在语法或其它翻译错误,仅供参考。如需获取准确内容,请参阅链接中的英语原文或自行翻译。

https://e2e.ti.com/support/tools/code-composer-studio-group/ccs/f/code-composer-studio-forum/567253/ccs-cc2650-copy-character-buffer-data-to-integer-type-variable

部件号:CC2650

工具/软件:Code Composer Studio

您好,

我正在尝试将缓冲区数据(字符类型)复制到整数类型(uint8_t)的变量。

假设我有1个Buffer BUFTYPE txBufmesdata2[]="78" ,此处78存储或接收 为char类型。

我想将该78复制到变量中,例如 H (int type)。 我收到与类型不兼容的错误。

您是否可以建议任何替代方法或方法来复制数据。

  • 请注意,本文内容源自机器翻译,可能存在语法或其它翻译错误,仅供参考。如需获取准确内容,请参阅链接中的英语原文或自行翻译。

    您打算为整数变量H分配什么?  字符串"78"的地址?  字符串"78"中的字符值?  还是整数值78?

    谢谢,此致,

    -George