【发布时间】:2018-05-02 08:17:03
【问题描述】:
假设我们有一个最多包含 50 个元素的结构体数组,这些元素将从缓冲区写入函数依次添加。如果未达到最大项目数,如何找到当前在数组中录制的数量?
typedef struct
{
remoteInstructionReceived_t instruction;
uint16_t parameter;
} instructionData_type;
remoteInstructionReceived_t commandBuffer[50];
【问题讨论】:
-
使用变量来跟踪它?
-
@FelixPalmen 我就是这样做的,已经。是最合理的解决方案。
标签: c arrays data-structures struct