简体   繁体   English

C中已定义类型实现的队列

[英]Queue of defined type implementation in C

I am trying to find an implementation of a queue to use it to hold processes that are of type GDB. 我试图找到队列的实现,以使用它来保存GDB类型的进程。 I have been looking all over the place and whatever I use I get an incompatible type when i try to enqueue the process of type GDB in the queue. 我一直到处寻找,无论我使用什么类型,当我尝试将GDB类型的进程加入队列时,都会得到一个不兼容的类型。 Anyone knows an implementation of a queue that I can use or Hash_table ? 任何人都知道我可以使用的队列或Hash_table的实现吗?

Any general-purpose queue worth using (including one you could roll on your own) should allow you to store void * , no questions asked. 任何值得使用的通用队列(包括您可以自行滚动的队列)都应允许您存储void * ,而不会提出任何问题。

So you should only store the address of whatever "process of type GDB" means. 因此,您只应存储“ GDB类型的进程”所指的地址。

我用这个 ,对我有用。

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM