#include <iostream>
using namespace std;
void readMatrix(int a[][10], int R, int C){
for(int i=0; i<R; i++){
for(int j=0; j<C; j++){
cin>>a[i][j];
}
}
}
void printMatrix(int a[][10], int R, int C){
for(int i=0; i<R; i++){
for(int j=0; j<C; j++){
cout<<a[i][j];
}
}
}
int main() {
int r,c;
cin>>r>>c;
int a[][10];
cout<<"Reading Matrix : "<<endl;
readMatrix(a, r, c);
cout<<"Printing Matrix : "<<endl;
printMatrix(a, r, c);
return 0;
}
I am trying to read a matrix and then print it. But I am getting this error:
Compiling failed with exitcode 1, compiler output:
prog.cpp: In function `int main()':
prog.cpp:21:9: error: storage size of
a
isn't knownint a[][10];
I am a novice in C++, so please help me debug this.