Originally Posted by
laserlight
Why nor provide a concrete example to demonstrate what you are talking about?
I would do it but is impossible. The programs are too much long.
I can do an example for my question:
I create a structure like this for a list of clusters:
Code:
struct cluster_type{
int index;//indice del cluster
int totElements;//number of elements in the cluster
elementType *elements;//pointer to the elements of the cluster
clusterType *nextCluster;//point to next Cluster
int centroid;//the centroid
};
I use this in a while loop:
Code:
while (..){
clusters=(clusterType *)malloc(k*sizeof(clusterType));
//....procedures to create elements in the list
free(rowClusters);
}
at a certain point seems that structures can't be allocate anymore.
The question is: What happen when I use the free function?