【发布时间】:2021-04-26 03:39:58
【问题描述】:
所以我找到了这个
public:
ListElem(string s);
string getData(void) const;
ListElem* getNext(void) const;
ListElem* getPrev() const;
顺便说一句,这是用 cpp 编写的头文件中列表的 sn-p
谁能告诉我“(void)”是干什么用的? methodName() 和 methodName(void) 的区别在哪里?
【问题讨论】:
-
看起来像 C 的遗物,这两个签名之间存在差异。请参阅this question 了解更多信息。
-
@NathanPierson 绝对在我看来是重复的......(然后小行星打败了我)
标签: c++