这是我的教科书中的练习作业,用于计算分数.它需要7分,并且最高和最低.
我不认为有语法错误,但我得到一个未解决的外部符号错误.我寻找类似的问题,似乎问题可能是使用函数而不是定义它.我已经定义了所有函数,但在main或calculatecore中可能都不正确.我是c ++的新手,非常感谢您解决这个问题.谢谢
这是我在VisualStudio上遇到的错误
错误LNK2019:函数_main中引用的未解析的外部符号"float __cdecl calculateScore(float*const,int,float)"(?calculateScore @@ YAMQAMHM @ Z)
#include <iostream>
using namespace std;
void printHeader(int judges);
void enterData (float scores[], int judges, float difficulty);
float calculateScore(float scores[], const int judges, float difficulty);
int findLeast(float scores[], const int judges);
int findMax(float scores[], const int judges);
int main () {
const int judges = 7;
float scores [judges];
float difficulty = 0;
float finalscore = calculateScore(scores, judges, difficulty);
printHeader (judges);
enterData (scores, judges, difficulty); // get user input
findLeast(scores, …Run Code Online (Sandbox Code Playgroud)