**已关闭。**此问题需要debugging details。当前不接受答案。
编辑问题以包括desired behavior, a specific problem or error, and the shortest code necessary to reproduce the problem。这将有助于其他人回答问题。
19小时前关闭
Improve this questionroster.cpp
中的错误:
“Roster::parse”的行外定义的返回类型与声明中的返回类型不同
预期语句student.cpp
中的错误:
“getDegreeProgram”的行外定义与“Student”中的任何声明都不匹配
函数声明符后应为函数体
我尝试在roster.h
中修复parse
,但它不起作用。我找不到roster.cpp
中多余或丢失的花括号。
我对getDegreeProgram
的错误感到困惑。
这里是链接:https://github.com/peonybliss/Class-Roster.git
1条答案
按热度按时间kqqjbcuj1#
这很简单,roster.cpp中的函数与roster.h中声明的任何函数都不匹配
在roster.h中,您有此
但是在roster.cpp中你有这个
这不仅与roster.h中的任何内容都不匹配,而且实际上是您在roster.cpp中定义的
parse
的第二个版本student.cpp文件以以下代码结束
编译器告诉你,它希望你在这里定义一个函数,比如
当你成为一名程序员时,你会发现关注细节是一项至关重要的技能,这两个错误都不难理解,只是很难发现。