I am trying to get this simple program to work but I have some errors I don't understand as I am new to C++. I am getting a not declared in scope for my function initialize and am having trouble using arrays in the function header. Can someone help me please?
My code is the following:
#include <iostream>
#include <string>
using namespace std;
char[][] initialize(char[][]);
int main(){
int array[3][3];
initialize(array);
cout << array[0];
return 0;
}
char[][] initialize(char[][] a){
for(int i = 0; i < a.length(); i++){
for(int j = 0; j < a[].length(); j++){
a[i][j] = '\0';
}
}
return a;
}