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/TMS320C5515:scanf 正在等待输入。

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

https://e2e.ti.com/support/tools/code-composer-studio-group/ccs/f/code-composer-studio-forum/939514/ccs-tms320c5515-scanf-is-not-waiting-to-give-input

器件型号:TMS320C5515

工具/软件:Code Composer Studio

尊敬的所有人:

我在 Code Composer Studio 中遇到了有关 scanf 函数的问题。  我使用 Spectrum Digital 的 eZ-DSP 板和 CCS 对 C5515 DSP 进行编程。

我使用以下代码:

#include

void main (void){

字符名称[20];
printf ("您的姓名是什么?\n");
scanf("%f",name);

printf ("Hello to DSP、%s!\n"、name);  

}

在上面的代码中、我没有收到等待 CCS 中控制台上输入的提示。  因此、我会得到一些奇怪的数据。  

你叫什么名字?
您好、DSP、±H×ëõT (4ÒýݾsÁ?ŸÓ…)

使用调试器、它只是跳过 scanf 函数。  

我使用 CCS 10、编译器版本为 TI v4.4.1。  是否有任何解决方案可以帮助我。  

谢谢