|
-
February 8th, 2011, 11:51 AM
#1
Dynamic Matrix
Hello,
i've a question: how can I get the access to all the elements of a dynamic matrix?
I create a dynamic matrix in this way:
Cout<<"insert matrix dimensions";
cin>>n;
int ** matrix= new int * [n];
for (int i=0;i<n;i++)
matrix [n]= new int [n];
//but when I try to initialize the element in this way:
for (int i=0;i<n;i++)
for (int J=0;j<n;j++)
matrix [i]*[j]=0;
the program gives me an error, how could I insert and modify all the location of the dynamic matrix?
Thanks a lot for attention
Posting Permissions
- You may not post new threads
- You may not post replies
- You may not post attachments
- You may not edit your posts
-
Forum Rules
|
Click Here to Expand Forum to Full Width
|