F
Frank
Hi,
I have the following problem with dynamic memory:
int main(){
for(){
int (**w)=new int *[N1];
for(m = 0; m < N1; m++) {
w[m]= new int[N1];
for(j = 0; j < N1; j++) {
w[m][j] = 0;
}
}
}
delete [] w;
}
This gives the error: 259: error: 'w' was not declared in this scope
I do not understand why a dynamic memory has a scope. (w is defined in
main and not in a class or function).
Does anyone know what is the problem here?
Thanks!
Frank
I have the following problem with dynamic memory:
int main(){
for(){
int (**w)=new int *[N1];
for(m = 0; m < N1; m++) {
w[m]= new int[N1];
for(j = 0; j < N1; j++) {
w[m][j] = 0;
}
}
}
delete [] w;
}
This gives the error: 259: error: 'w' was not declared in this scope
I do not understand why a dynamic memory has a scope. (w is defined in
main and not in a class or function).
Does anyone know what is the problem here?
Thanks!
Frank