Function call in arrays

.cpp:30:14: error: cannot convert ‘int ()[m]’ to 'int ()[100]’
30 | waverow(n,m,arr);
| ^~~
| |
| int ()[m]
waveprint.cpp:4:30: note: initializing argument 3 of 'void waverow(int, int, int (
)[100])’
4 | void waverow(int n,int m,int arr[100][100]){
| ^~~~~~~~~

//getting this error for the following code:
#include
using namespace std;

void waverow(int n,int m,int arr[100][100]){
for(int row=0; row<n; row++){
if(row%2==0){
for(int col=0; col<n;col++){
cout<<arr[row][col]<<’,’<<’ ‘;
}
}
else{
for(int col=n-1; col>=0;col–){
cout<<arr[row][col]<<’,’<<’ ';
}
}
}

}
int main() {
int n,m;
cin>>n;
cin>>m;
int arr[n][m];
for(int i=0; i<n; i++){
for( int j=0;j<n;j++){
cin>>arr[i][j];
}
cout<<endl;
}
waverow(n,m,arr);
return 0;
}

hi @srivastavaayush1611_3fd51b257da0b834 updated

I hope I’ve cleared your doubt. I ask you to please rate your experience here
Your feedback is very important. It helps us improve our platform and hence provide you
the learning experience you deserve.

On the off chance, you still have some questions or not find the answers satisfactory, you may reopen
the doubt.