my problem in c++

Hi every one!

i would like you to help me to write this code

1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
#include<iostream>
using namespace std;
bool Update(int sales[2][4]);
{
	int salse[2][4]={{1,2,3},{1,2,3,4}};
return bool;
}
int main()
{
	int Week;
	int Department;
	cout<<"Enter The Department and week Number";
	cin>>Department;
	cin>>Week;
	cout<<Update(sales[2][4]);
return 0;
}

this for sales array:
Dep/Week Week 1 Week 2 Week 3 Week 4
Department 1 12000 13500 10000 14000
Department 2 34600 20000 18700 21400
Department 3 16500 11670 14320 17500

i have problem with functions & and arrays

thanks for everything
that's why it's called a education
that's why it's called a education


*an

You want to update the sales array with the new data. You will need a function that takes takes a week, which is an index to the second part of the 2d array, and a department, which is an index into the first part of the 2d array. It should also take the value if which you want to set.

In your design the sales array is global, so you will want to move it from the Update function to below the namespace declaration.

Please read here about creating functions:
http://www.cplusplus.com/doc/tutorial/functions/
Topic archived. No new replies allowed.