gpt4 book ai didi

c++ - 错误调用函数 : "argument of type "int"is incompatible with parameter of type "int *"

转载 作者:行者123 更新时间:2023-11-28 03:28:05 25 4
gpt4 key购买 nike

<分区>

我被分配到一个需要 25 个 double 组的程序。然后需要翻转显示。我似乎无法使用 flipArray 函数。

#include <iostream>

using namespace std;

const int NUMSCORES = 25;
//double getData(double &myArray);
void flipArray (int arr[]);


int main(void)
{
int scores[NUMSCORES], i;
for(i=0; i<NUMSCORES; i++){
cout << "Please enter scores #" << i+1 << ": ";
cin >> scores[i];
}

cout << "Your test scores:\n";
for(i=0; i<NUMSCORES; i++)
cout << "\tTest score #" << i+1 << ": " << scores[i] << endl;

flipArray(NUMSCORES);
return;
}

void flipArray(int arr[])
{
int j;
for (j=NUMSCORES-1; j>=0; j--)
cout << arr[j] << "\t";
}

25 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com