こんにちは私はメインに関数を呼び出したいところに次のc++コードを持っています、以下は私のコードです:
#include <iostream>
#include <numeric>
int main()
{
using namespace std;
readData();
int sumA = accumulate(A, A + sizeof(A) / sizeof(int), 0);
int sumB = accumulate(B, B + sizeof(B) / sizeof(int), 0);
cout << ((sumA > sumB) ? "Array A Greater Than Array B\n" : "Array B Greater Than Array A\n");
return 0;
}
void readData()
{
int A[] = { 1, 1, 8};
int B[] = { 2, 2, 2};
}
cliで次のエラーが発生しました:
test.cpp:3:7: error: storage size of ‘B’ isn’t known
test.cpp:4:7: error: storage size of ‘A’ isn’t known
私はここでどこが間違っていますか?ありがとう