gpt4 book ai didi

c - 如何在 IAR IDE Watch 窗口中通过指针显示数组范围?

转载 作者:太空狗 更新时间:2023-10-29 15:02:15 26 4
gpt4 key购买 nike

在 IAR Embedded Workbench 中,我有一个指向内存缓冲区的指针。观看指针时,我可以看到它所指向的单词的内容。我如何告诉 Watch View 列出缓冲区的范围,从指针开始,对于某些指定长度的元素?

例如,输入表达式:

myPtr[0..2]

将显示相当于三个表达式的信息:

myPtr[0]
myPtr[1]
myPtr[2]

最佳答案

来自 Iar Embedded Workbench (9.20) 帮助:

In windows where you can edit the Expression field and in the Quick Watch window, you can specify the number of elements to be displayed in the field by adding a semicolon followed by an integer. For example, to display only the three first elements of an array named myArray, or three elements in sequence starting with the element pointed to by a pointer, write:

myArray;3

To display three elements pointed to by myPtr, myPtr+1, and myPtr+2, write:

myPtr;3

Optionally, add a comma and another integer that specifies which element to start with. For example, to display elements 10–14, write:

myArray;5,10

To display myPtr+10, myPtr+11, myPtr+12, myPtr+13, and myPtr+14, write:

myPtr;5,10

关于c - 如何在 IAR IDE Watch 窗口中通过指针显示数组范围?,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/26003202/

26 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com