|
1
4
我认为你的问题在于:
你在缩放
换句话说,
记住,你最终会溢出来的
|
|
|
2
1
你在繁殖
|
|
|
3
0
|
|
|
4
0
你可以这样做:
|
|
|
5
0
你可以请客 队列 作为一个数组,然后推送项目应该很简单: void push(struct myInfo info) {
if (queue_size < MAX_QUEUE) {
printf("Pushing %s to %d\n", info.data, queue_size);
queue[queue_size] = info;
queue_size++;
} else {
printf("ERROR: Queue is full.\n");
/* alternatively you could have a queue_insertion_point
variable to keep track of where you are in the queue
and use that as your index into your array. You'd then
reset it to 0 (to wrap around) when it hit MAX_QUEUE.
You need to ensure you don't overwrite data currently
in the queue by comparing it against queue_head */
}
}
|
|
|
MaPo · Linux,设置锁定ICMP_过滤器选项 1 年前 |
|
Doohyeon Won · 内联函数上的奇怪现象?[关闭] 1 年前 |
|
|
Bobby · 复合字面值总是左值吗? 1 年前 |
|
9-Pin · C: 嵌套结构的堆栈内存分配 1 年前 |