fork download
  1. #include <stdlib.h>
  2. #include <string.h>
  3.  
  4. int main(void){
  5. int *pInt;
  6. int **ppInt1;
  7. int **ppInt2;
  8.  
  9. pInt = (int*)malloc(sizeof(int));
  10. ppInt1 = (int**)malloc(10*sizeof(int*));
  11. ppInt2 = (int**)malloc(10*sizeof(int*));
  12.  
  13. for ( int i = 0 ; i < 10 ; i++ ){
  14. ppInt2[i] = malloc( sizeof(int) );
  15. }
  16.  
  17. free( pInt );
  18. free( ppInt1 );
  19.  
  20. for ( int i = 0 ; i < 10 ; i++ ){
  21. free ( ppInt2[i] );
  22. }
  23.  
  24. free( *ppInt2 );
  25. }
  26.  
Success #stdin #stdout 0s 4552KB
stdin
Standard input is empty
stdout
Standard output is empty