int main(){
string array[][]=get_element(2,3);
return 0;
}
string get_element(int numrow,int numcol){
string result_array[numrow][numcol];
for (int i=0;i<numrow;i++)
{
for (int j=0;j<numcol;j++)
{
result_array[i][j]=" ";
}
}
return result_array; //ERROR is on this line
}
I get error: conversion from ‘std::string (*)[(((long unsigned int)(((long int)numcol) + -0x00000000000000001)) + 1)]’ to non-scalar type ‘std::string’ requested
I must be missing something, how do I properly return a 2-d string array from a function?
Thanks in advance