我有一个1-d数组和一个2-d数组。我将它们都放在我用来读取.txt文件信息的函数中。
我的数组全部设置完毕,我的函数设置正确,据我所知,我无法弄清楚如何实际调用其中包含2个独立数组的函数。以下是相关信息,请让我知道我需要输入main来调用这些功能。谢谢!
void getSales(double[][QUARTERS], int[]); // places sales figures into the array
void printSales(double[][QUARTERS], int[]); // prints data as a table
void printTableHeading(); // prints table heading
int main()
{
double sales[YEAR_COUNT][QUARTERS]; // 2D array to hold the sales transactions
int years[YEAR_COUNT]; // 1D array to hold the years
return 0;
}
void printTableHeading()
{
}
void getSales(double salesTable[][QUARTERS],int yearArray[])
{
}
void printSales(double salesTable[][QUARTERS], int yearArray[])
{
}
答案 0 :(得分:1)
int main(
{
getSales(sales, years); // Will call your get sales function
printSales(sales, years); // Will call your print sales function
}