-5
누군가이 오류의 원인을 파악하는 데 도움이 될 수 있다면 매우 행복 할 것입니다. 내 코드를 컴파일 해야하는 것 같아요 아직 내 void 함수를 모두이 오류가 발생합니다. 여기 오류 LNK2019 - 내 코드가 컴파일해야하지만이 오류가 발생합니다.
내 코드가
은 ...#include<iostream>
#include<iomanip>
#include<fstream>
using namespace std;
// global constant variables
const int YEARS = 8;
const int MONTHS = 12;
const int SPACER =5;
// function prototypes
// function to read in values
void getData(double[][MONTHS], int[]);
// function to display values in table format
void printData(double[][MONTHS], int[]);
// function to print data to screen in table format using arrays
int main()
{
double rain [YEARS][MONTHS];
int years[YEARS];
getData(rain, years);
printData(rain, years);
return 0;
}
// function definitions
void getData (double rainArray[][YEARS], int yearArray[])
{
ifstream fin;
fin.open("rainfall.txt");
if (!fin)
{
cout << "Error opening file, shutting down now.\n" ;
exit(EXIT_FAILURE);
}
else
{
for(int i = 0; i < YEARS; i++)
{
fin >> yearArray[i];
for (int j = 0; j < MONTHS; j++)
{
fin >> rainArray[i][j];
}
}
}
fin.close();
}
void printData (double rainArray[][YEARS], int yearArray[])
{
for (int i = 0; i < YEARS; i++){
cout << yearArray[i] << setw(SPACER);
for (int j = 0; j < MONTHS; j ++)
cout << rainArray[i][j] << setw(SPACER);
}
cout << endl;
}
정확하게 오류 메시지가 무엇입니까? * 실제 * 오류 메시지와 해당 오류를 일으킨 행 (해당되는 경우)을 포함시켜주십시오. –
그 오류의 의미를 찾았습니까? –
해당 기능은 어디에 구현 되었습니까? –