Free Sparse Matrix

This is a discussion on Free Sparse Matrix within the C Programming forums, part of the General Programming Boards category; The function receives pointer to the structure that contains a sparse matrix and releases all the engaged memory by the ...

  1. #1
    Registered User
    Join Date
    Jan 2009
    Posts
    10

    Free Sparse Matrix

    The function receives pointer to the structure that contains a sparse matrix and releases all the engaged memory by the structure.

    How to realize this?


    Code:
    #include <stdlib.h>
    #include <stdio.h>
    
    typedef int Elem;
    typedef struct cell Cell;
    typedef Cell * Matrix;
    
    struct cell {
    	int row;
    	int col;
    	Cell * right;
    	Cell * down;
    	Elem value;
    };
    Code:
    void freeSparseMatrix(Matrix m)
    {
    ....
    }

  2. #2
    and the hat of int overfl Salem's Avatar
    Join Date
    Aug 2001
    Location
    The edge of the known universe
    Posts
    32,824
    If you dance barefoot on the broken glass of undefined behaviour, you've got to expect the occasional cut.
    If at first you don't succeed, try writing your phone number on the exam paper.
    I support http://www.ukip.org/ as the first necessary step to a free Europe.

Popular pages Recent additions subscribe to a feed

Similar Threads

  1. Genrate sparse matrix - C99
    By anirban in forum C Programming
    Replies: 0
    Last Post: 06-11-2008, 12:44 AM
  2. Replies: 1
    Last Post: 03-08-2006, 06:47 PM
  3. Matrix and vector operations on computers
    By DavidP in forum A Brief History of Cprogramming.com
    Replies: 11
    Last Post: 05-11-2004, 07:36 AM

1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21