我正在尝试queue使用C 实现一个结构.我的实现非常简单; 队列只能保存ints而不能保留其他内容.我想知道我是否可以模拟C++模板C(可能通过使用预处理器#define),以便我queue可以保存任何数据类型.
queue
int
C++
C
#define
注意:我不想用void*.我认为它有点风险,很容易导致奇怪的运行时错误.
void*
c templates
c ×1
templates ×1