Matrix help

Nov 29, 2011 at 2:41am
i have this code here that was provided by my teacher

1
2
8. const int SIZE = 50;
9. typedef double[SIZE][SIZE] Matrix;


however, this is what i get for line 9, not sure what i'm doing wrong

lc.cpp:9: error: expected unqualified-id before â[â token
Nov 29, 2011 at 2:57am
It should actually be:

typedef double Matrix[SIZE][SIZE];
Nov 29, 2011 at 3:04am
Well thats what I thought but that was the code we were given, and from that code we are supposed to define different Matrices such as

Matrix a;
Matrix b;
Matrix c;
...

This is confusing me...
Nov 29, 2011 at 3:05am
and then pass Matrix a and Matrix b to a function called

Matrix multiply(Matrix a, Matrix b)
Nov 29, 2011 at 3:36am
Is that the function spec for multiply() that the teacher gave you?

It's returning an array, which you can't do.

Jim
Topic archived. No new replies allowed.