Main.cc: In function ‘int solve(char**, char**, int, int, int)’:
Main.cc:56:19: error: ‘malloc’ was not declared in this scope
int *result = malloc(N * M * sizeof(int));
^~~~~~
Main.cc:60:12: error: invalid conversion from ‘int*’ to ‘int’ [-fpermissive]
return result;
^~~~~~
Main.cc: In function ‘int main()’:
Main.cc:66:16: error: ‘malloc’ was not declared in this scope
char **H = malloc(N * sizeof(char*));
^~~~~~
Main.cc:77:24: error: invalid conversion from ‘int’ to ‘int*’ [-fpermissive]
int *result = solve(H, V, N, M, K);
~~~~~^~~~~~~~~~~~~~~
Main.cc:78:20: error: ISO C++ forbids comparison between pointer and integer [-fpermissive]
if (result == -1) {
^
Main.cc:88:9: error: ‘free’ was not declared in this scope
free(H[i]);
^~~~
Main.cc:88:9: note: suggested alternative: ‘fseek’
free(H[i]);
^~~~
fseek
Main.cc:90:5: error: ‘free’ was not declared in this scope
free(H);
^~~~
Main.cc:90:5: note: suggested alternative: ‘fseek’
free(H);
^~~~
fseek
Main.cc:65:10: warning: ignoring return value of ‘int scanf(const char*, ...)’, declared with attribute warn_unused_result [-Wunused-result]
scanf("%d%d%d", &N, &M, &K);
~~~~~^~~~~~~~~~~~~~~~~~~~~~
Main.cc:69:14: warning: ignoring return value of ‘int scanf(const char*, ...)’, declared with attribute warn_unused_result [-Wunused-result]
scanf("%s", H[i]);
~~~~~^~~~~~~~~~~~
Main.cc:74:14: warning: ignoring return value of ‘int scanf(const char*, ...)’, declared with attribute warn_unused_result [-Wunused-result]
scanf("%s", V[i]);
~~~~~^~~~~~~~~~~~