Referencing arrays initialized within a class

The following code compiles ok under g++ 4.6.3, but won't execute .
Can anyone explain why ??

class Workspace
{ public:
int n ;
double **x1, *y1 ;

Workspace(int nn)
{ n=nn;
double x1 [n+1][n] , y1 [n+1];
}
} ;

Workspace state (2);

int main ()
{ for (int kk=0; kk< state.n; kk++)
{ state.y1[kk] = double(kk);
state.x1[0][kk]= 2.0* kk;
}
return 0
}
Topic archived. No new replies allowed.