请注意,本文内容源自机器翻译,可能存在语法或其它翻译错误,仅供参考。如需获取准确内容,请参阅链接中的英语原文或自行翻译。
器件型号:TMS570LS1224 您好!
我已经 在函数中将数组定义为: uint8_t list_array[size];。
当此行执行时、控件跳转至退出。 并暂停程序执行。
如何使用可变长度数组?
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.
您好!
我已经 在函数中将数组定义为: uint8_t list_array[size];。
当此行执行时、控件跳转至退出。 并暂停程序执行。
如何使用可变长度数组?
您好、Vidya:
[quote userid="588114" url="~/support/microcontrollers/arm-based-microcontrollers-group/arm-based-microcontrollers/f/arm-based-microcontrollers-forum/1309260/tms570ls1224-jumping-to-abort-when-a-variable-length-array-is-executed-as-shown 如何使用可变长度数组?在 C 语言中,不能在运行时改变数组的大小。 数组大小只能在编译阶段固定。
如果要创建动态数组(即要在运行时更改大小),则应使用链接列表。
--
谢谢。此致、
Jagadish。
您好!
可变长度数组是 C99 Standard 提供的一项附加功能。
我想这个特性出现在 CCS 的编译器中、因为在我定义这个数组时、它并未产生任何编译器错误。
即使在调试模式下、也不会导致任何错误、而是跳转到此 SDK 中内置的中止函数。
我想进一步了解我之前附加的 loader_exit 和 ABORT 函数。
请单击以下链接。
https://www.geeksforgeeks.org/variable-length-arrays-in-c-and-c/