igraph-help
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: [igraph] C code on attributes is confusing me


From: Marco Guidetti
Subject: Re: [igraph] C code on attributes is confusing me
Date: Tue, 19 Apr 2011 13:54:17 +0200
User-agent: Mozilla/5.0 (X11; U; Linux i686; en-US; rv:1.9.1.16) Gecko/20110307 Icedove/3.0.11

On 04/19/2011 01:47 PM, Gábor Csárdi wrote:
Hi,

On Tue, Apr 19, 2011 at 7:37 AM, Marco<address@hidden>  wrote:
[...]
    fprintf(stderr, "%d, %d\n", (int) IGRAPH_VIT_GET(g_vit),VAN(&graph,state,
(int) IGRAPH_VIT_GET(g_vit)));
    IGRAPH_VIT_NEXT(g_vit);
[...]

VAN() returns a double, convert the result to an int, or use %g instead of %d.

Btw. it is really worth turning on compiler warnings, gcc gives a
warning for this one.

Thank you Gabor,

I didn't realize it while reading the doc: since VAN is a shortcut to igraph_cattribute_VAN (which returns igraph_real_t) I should have thought of this.
Usually I compile with -Wall, but this time, I simply forgot.

I guess I am a bit more rusty with C than I thought!

Thank you again,

marco



reply via email to

[Prev in Thread] Current Thread [Next in Thread]