So i have this complex class , and i want to have an 2d array of complex numbers this is part of the code not all the code
class Complex {
public:
/* construction/destruction */
Complex(double r, double i) { this->r = r; this->i = i; }
Complex() { r=0.0; i=0.0; }
~Complex() { r=0.0; i=0.0; }
/* operations */
Complex operator+(Complex &c) { return Complex( r+c.r, i+c.i ); }
double r, i;
};
int main()
{
const int HEIGHT = 256;
const int WIDTH = 256;
Complex G[HEIGHT][WIDTH];
}
so the line Complex G[HEIGHT][WIDTH]; is the line that causes the problem , any idea why ?
Galone, which is typically the overall limit.Complexobjects. It's really not a ... complex ... thing to understand.malloc- and maybe create an access function as part of the class in order to keep the indexing simple.malloc/vector/.