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.

[参考译文] TMS320F2800133:strlen 的不同行为

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

https://e2e.ti.com/support/microcontrollers/c2000-microcontrollers-group/c2000/f/c2000-microcontrollers-forum/1418786/tms320f2800133-different-behavior-for-strlen

器件型号:TMS320F2800133
主题中讨论的其他器件:TMS320F2800157SysConfig

工具与软件:

在使用"strlen"时、我会得到以下代码的不同结果。

Fullscreen
1
2
3
4
5
6
7
8
char str[] = "Hello my dear world";
uint8_t len = strlen(str");
// HERE len VALUE IS 23 ????????
len = strlen("Hello my dear world");
//HERE len VALUE IS 32080 ???????
XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX
"

但是、当我使用 TMS320F2800157时、该函数效果很好(长度为19)并且没有问题。