Thread: Free question

  1. #1
    Disturbed Boy gustavosserra's Avatar
    Join Date
    Apr 2003
    Posts
    244

    Free question

    Does the free function deallocate the memory of matrices of pointers?
    Code:
       int **matrix;
       int i;
       matrix = (int **) malloc ( NUMBER );
       for(  i = 0 ; i < NUMBER ; i++ )
           matrix[i] = (int *)malloc(  ANOTHER_N );
       }
    
        free(matrix);
    Nothing more to tell about me...
    Happy day =)

  2. #2
    Registered User
    Join Date
    Jul 2003
    Posts
    102

    free

    free memory occupied by ANOTHER_N and then free NUMBER.
    Saravanan.T.S.
    Beginner.

Popular pages Recent additions subscribe to a feed

Similar Threads

  1. Design question
    By MacGyver in forum C Programming
    Replies: 9
    Last Post: 05-17-2007, 02:36 AM
  2. Simple question about free()
    By fanoliv in forum C Programming
    Replies: 7
    Last Post: 06-16-2006, 11:14 AM
  3. question about free()
    By TalosChen in forum C Programming
    Replies: 5
    Last Post: 05-20-2006, 06:11 PM
  4. SIGABRT upon free()
    By registering in forum C Programming
    Replies: 2
    Last Post: 07-19-2003, 07:52 AM
  5. Very simple question, problem in my Code.
    By Vber in forum C Programming
    Replies: 7
    Last Post: 11-16-2002, 03:57 PM