1-d结合2-d阵列.需要调用main中的函数
1-d combined with 2-d array. Need functions calls for within main
我有一个一维数组和一个二维数组。我把它们都放在一个函数中,我用它来读取.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
}
相关文章:
- 为什么随机数生成器不在void函数中随机化数字,而在main函数中随机化
- "main"函数堆栈中的对象在第一个任务运行时被覆盖 (FreeRTOS)
- 为什么 'main' 函数中的局部 int 变量会自动初始化?
- 为什么在我的 main 函数中声明整数后我的整数数组中会出现错误?
- 尝试更改 main 函数内的全局变量值时出现编译错误 C++.
- 我应该在 main 函数中写什么来测试我的问题?
- 如何在 main 函数中输出两个新字符串C++?
- 有没有办法通过 main 函数访问受保护的矢量大小而无需将其转换为公共?
- 我们可以在main函数中声明嵌套类对象吗
- 为什么Main函数上的Sleep()会停止所有线程
- C++ main 函数中初始化静态变量
- 为什么VC++/MFC没有main函数?
- 如何在 main 函数的一个对象中初始化两个类的值?C++
- 在 C++ 中解析 main 函数的大量输入的正确方法是什么
- 如何编写一个 void 函数,该函数将在数组中搜索值,并通过引用将该值的位置传递回 main 函数
- 如何将矩阵参数发送到从C 中的MAIN函数
- 如何从子例程函数获取到 main 函数的返回值
- 为什么我不能在 main 函数中更改类的公共变量
- C++编译错误:多个定义"main",但项目中只有一个 main 函数
- 如何使用 x86 程序集在 c 中访问 main 函数中的变量