1-d结合2-d阵列.需要调用main中的函数

1-d combined with 2-d array. Need functions calls for within main

本文关键字:main 函数 调用 结合 2-d 阵列 1-d      更新时间:2023-10-16

我有一个一维数组和一个二维数组。我把它们都放在一个函数中,我用它来读取.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[])
{
}
int main(
{
      getSales(sales, years);  // Will call your get sales function
      printSales(sales, years); // Will call your print sales function
}