On Wed, Apr 14, 2010 at 9:35 AM, Tamas Nepusz
<address@hidden> wrote:
> Could you give me an example how I can make vector of 100 igraph_vector_t objects and how I should handle memory
> thank you.
Well, if you only need 100 vectors (in other words, if the number of igraph_vector_t objects you need is fixed), you don't really need an igraph_vector_ptr_t for that, you can simply allocate 100 igraph_vector_t objects using calloc:
igraph_vector_t* vectors;
vectors = (igraph_vector_t*)calloc(100, sizeof(igraph_vector_t));
for (i = 0; i < 100; i++) {
igraph_vector_init(vectors + i);
}
[...do whatever you want with your vectors...]
for (i = 0; i < 100; i++) {
igraph_vector_destroy(vectors + i);
}
free(vectors);
Code untested, but shows the general idea.
--