Hi to All,
I need to fill a matrix as this:
N is an integer, that I don't know.Code:char mat [N] [N]
In my program I have a construct for its Input as this.
Can work this scenario ?Code:cin >> N;
For Example can work this program?
This code is correct ? How can resolve my problem ?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; }
Thank you for help. Be patient with me; I am new in c++ programming.
Best Regards