Here is what I work with:
char* qdat[][NUMTBLCOLS];
char** tdat[];
char* ptr_web_data;
for(row_index = 0; row_index < number_rows; row_index++)
{
for(col_index = 0; col_index < number_cols; col_index++)
{
ptr_web_data = (char*) malloc((strlen(Data) + 1) * sizeof(char));
memcpy (ptr_web_data, column_text, strlen(column_text) + 1);
qdat[row_index][web_data_index] = ptr_web_data;
}
}
tdat[row_index] = qdat[col_index];
After the data is used, the allocated memory is allocated one at a time using free ().
for(row_index = 0; row_index < number_rows; row_index++)
{
for(col_index = 0; col_index < SARWEBTBLCOLS; col_index++)
{
free(tdat[row_index][col_index]);
}
}
Is there any way to free all allocated memory at once, for this array?
Thank.
source
share