About an indefinite matrix
Hi to All,
I need to fill a matrix as this:
N is an integer, that I don't know.
In my program I have a construct for its Input as this.
Can work this scenario ?
For Example can work this program?
Code:
#include <iostream.h>
int main()
{
int N; /max element for Matrix
char mat[N][N];
int i, j; /Counters
cout << 'Enter the number of Rows and Colums ';
cin >> N;
cout << endl;
cout << 'Enter the Matrix elements ' << endl;
for (i=0; i<N; i++)
{
for (j=0; j<N; j++)
cout << mat[i][j];
cout << endl;
}
cout << endl;
}
This code is correct ? How can resolve my problem ?
Thank you for help. Be patient with me; I am new in c++ programming.
Best Regards