keeps getting error
i want my zero_zero to minus the shifted_table and display out at the int main. but i keep getting error.can anybody tell me what is mistake?
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87
|
#include <iostream>
#include <iomanip>
#include <cmath>
#include <cstdlib>
using namespace std;
double shifted_block(double array[3][3]);
int main ()
{
// input number in 3X3 array
double a[3][3];
double zero_zero;
*(a+0)[0] = zero_zero;
double zero_one;
*(a+0)[1] = zero_one;
double zero_two;
*(a+0)[2] = zero_two;
cout << "Enter 1st row" << endl;
cin >> zero_zero >> zero_one >> zero_two;
double one_zero;
*(a+1)[0] = one_zero;
double one_one;
*(a+1)[1] = one_one;
double one_two;
*(a+1)[2] = one_two;
cout << "Enter 2nd row" << endl;
cin >> one_zero >> one_one >> one_two;
double two_zero;
*(a+2)[0] = two_zero;
double two_one;
*(a+2)[1] = two_one;
double two_two;
*(a+2)[2] = two_two;
cout << "enter 3nd row" << endl;
cin >> two_zero >> two_one >> two_two;
cout << zero_zero << " " << zero_one << " " << zero_two << " " << endl;
cout << one_zero << " " << one_one << " " << one_two << " " << endl;
cout << two_zero << " " << two_one << " " << two_two << " " << endl;
//display out
cout << shifted_block(zero_zero) << endl;
return 0;
}
// to minus 128 of the value input
double shifted_block(double array[3][3])
{
for (int countrow = 0; countrow < 3; countrow++) {
for (int countcolumn = 0; countcolumn < 3; countcolumn++){
return array[countrow][countcolumn] = array[countrow][countcolumn] - 128;
}
}
}
|
Topic archived. No new replies allowed.