Hi,
I have this function which is a part of an older lib. the thing is this function accepts char***, allocates the required memory and fills it up. However i need to accept this char*** as a 2D vector of strings, but I am having hard time makeing it work. Could anyone help me with this one.
example:
Code:
C:
function (char*** results){
results = (char ***) malloc(sizeof(char **)*num);
for (index=0; index<num; index++) {
results[index] = (char **)malloc(sizeof(char*)*size);
for (i=0; i<size; i++) {
results[index][i] = (char *)malloc(sizeof(char)*x));
// fill
}
}
C++:
vector<vector<string>> results;
function(&results);
cout << results[0][0]<< endl;
thank you!