【发布时间】:2020-03-03 06:30:34
【问题描述】:
我正在学习 c++,我的项目是关于队列的。
我有:
struct dough {
string code;
int stirringTime;
};
通常在我的任务中,我们使用int 而不是struct。这就是为什么我的删除功能有问题:
使用 int :
int delQ(Queue &Q) // => return int
如果我做:
struct delQ(Queue &Q) // => what do i return?
【问题讨论】:
-
如何声明一个返回 int 的函数?现在你将如何声明相同的函数但返回另一种类型,例如结构?
-
结构不是函数
标签: c++ function struct return-type