I would like to convert my c style memory allocation (calloc) to c++ style (new and delete). The way I am doing it at the moment in c is as follows:
Code:char** seq_array; seq_array = (char **)calloc( (nseqs) * sizeof (char *), sizeof(char) ); for(int i=0; i < nseqs; i++) seq_array[i] = (char *)calloc((length) * sizeof (char), sizeof(char));
This is to generate an array of size nseqs*length. I would like to change this to the c++ way of allocating memory. Would it be something like the following:
Code:seq_array = char**[nseqs][length];
And what about freeing up the memory?
Thanks for your help