Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- char ** 2dArray= NULL;
- int k = 0;
- int j = 0;
- do{
- k++;
- for (int i= 0; i<10; i++){
- j++;
- 2dArray=(char**)realloc(2dArray, (j+1)*10*sizeof(char*));
- 2dArray[j-1]=(char*)malloc(10 *sizeof(char));
- ....
- }
- }while(k<3)
- // free the memory
- for (int l = 0; l < j; l++){
- if (2dArray[l] != NULL)
- free(2dArray[l]); // here I get the error!
- }
- free(2dArray);
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement