[Top][All Lists]
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: [igraph] invalid conversion from 'void *' to 'const igraph_t *'
From: |
Gábor Csárdi |
Subject: |
Re: [igraph] invalid conversion from 'void *' to 'const igraph_t *' |
Date: |
Wed, 18 May 2011 13:10:43 -0400 |
You have to cast the void* pointer to igraph_t*, see below:
On Wed, May 18, 2011 at 1:08 PM, Yi Cao <address@hidden> wrote:
> Hello all,
>
> The following is part of my code,
> ......
> igraph_vector_ptr_t compolist;
> igraph_vector_ptr_init(&complist, 100);
> for (i=0; i<igraph_vector_ptr_size(&complist); i++)
> {
igraph_t *g = (igraph_t*)VECTOR(complist)[i];
size = igraph_ecount(g);
G.
> size=igraph_ecount(VECTOR(complist)[i]);
> if (size>max) max=size;
> }
> igraph_vector_ptr_destroy(&compolist);
> ......
> When I tried to compile it, it returned the following errors:
> error: invalide conversion from 'void *' to 'const igraph_t *';
> error: initializing argument 1 of ' igraph_integer_t igraph_ecount(const
> igraph_t *)'
>
> I do not know where the mistakes are in the code. Can anyone tell me the
> mistakes? Thank you very much.
>
> Best,
> Yi
>
> _______________________________________________
> igraph-help mailing list
> address@hidden
> https://lists.nongnu.org/mailman/listinfo/igraph-help
>
>
--
Gabor Csardi <address@hidden> MTA KFKI RMKI