Hi, I want to add some elements to an n*n array that the user specifies at the beginning. However, I'm getting a C2540 and C2440 error. Here is the code:
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16
double tridiagonal(){
int i, j, mainlength,answerlength;
double *a;
cout <<"Enter n*n matrix size";
cin >> mainlength;
a= newdouble [mainlength][mainlength];
for(i=0; i<mainlength; i++){
for(j=0; j<mainlength; j++){
cin >> new a[i][j];
}
}
//DO WHATEVER HERE
delete[] a;
}